diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_exchange.erl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 2f7ec54041..d5b96adff1 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -219,8 +219,16 @@ assert_args_equivalence(#exchange{ name = Name, arguments = Args }, -spec lookup (name()) -> rabbit_types:ok(rabbit_types:exchange()) | - rabbit_types:error('not_found'). - + rabbit_types:error('not_found'); + ([name()]) -> + [rabbit_types:exchange()]. + +lookup([]) -> []; +lookup([Name]) -> ets:lookup(rabbit_exchange, Name); +lookup(Names) when is_list(Names) -> + %% Normally we'd call mnesia:dirty_read/1 here, but that is quite + %% expensive for reasons explained in rabbit_misc:dirty_read/1. + lists:append([ets:lookup(rabbit_exchange, Name) || Name <- Names]); lookup(Name) -> rabbit_misc:dirty_read({rabbit_exchange, Name}). |
