|
20 | 20 |
|
21 | 21 | -export([recover/1, policy_changed/2, callback/4, declare/7, |
22 | 22 | assert_equivalence/6, assert_args_equivalence/2, check_type/1, |
23 | | - lookup/1, lookup_or_die/1, list/0, list/1, lookup_scratch/2, |
| 23 | + lookup/1, lookup_many/1, lookup_or_die/1, list/0, list/1, lookup_scratch/2, |
24 | 24 | update_scratch/3, update_decorators/1, immutable/1, |
25 | 25 | info_keys/0, info/1, info/2, info_all/1, info_all/2, info_all/4, |
26 | 26 | route/2, delete/3, validate_binding/2, count/0]). |
@@ -219,19 +219,22 @@ assert_args_equivalence(#exchange{ name = Name, arguments = Args }, |
219 | 219 |
|
220 | 220 | -spec lookup |
221 | 221 | (name()) -> rabbit_types:ok(rabbit_types:exchange()) | |
222 | | - rabbit_types:error('not_found'); |
223 | | - ([name()]) -> |
224 | | - [rabbit_types:exchange()]. |
| 222 | + rabbit_types:error('not_found'). |
225 | 223 |
|
226 | | -lookup([]) -> []; |
227 | | -lookup([Name]) -> ets:lookup(rabbit_exchange, Name); |
228 | | -lookup(Names) when is_list(Names) -> |
229 | | - %% Normally we'd call mnesia:dirty_read/1 here, but that is quite |
230 | | - %% expensive for reasons explained in rabbit_misc:dirty_read/1. |
231 | | - lists:append([ets:lookup(rabbit_exchange, Name) || Name <- Names]); |
232 | 224 | lookup(Name) -> |
233 | 225 | rabbit_misc:dirty_read({rabbit_exchange, Name}). |
234 | 226 |
|
| 227 | + |
| 228 | +-spec lookup_many([name()]) -> [rabbit_types:exchange()]. |
| 229 | + |
| 230 | +lookup_many([]) -> []; |
| 231 | +lookup_many([Name]) -> ets:lookup(rabbit_exchange, Name); |
| 232 | +lookup_many(Names) when is_list(Names) -> |
| 233 | + %% Normally we'd call mnesia:dirty_read/1 here, but that is quite |
| 234 | + %% expensive for reasons explained in rabbit_misc:dirty_read/1. |
| 235 | + lists:append([ets:lookup(rabbit_exchange, Name) || Name <- Names]). |
| 236 | + |
| 237 | + |
235 | 238 | -spec lookup_or_die |
236 | 239 | (name()) -> rabbit_types:exchange() | |
237 | 240 | rabbit_types:channel_exit(). |
|
0 commit comments