diff options
| author | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-09-08 14:57:10 +0100 |
|---|---|---|
| committer | Ayanda Dube <ayanda.dube@erlang-solutions.com> | 2015-10-07 08:46:40 +0100 |
| commit | 4dd0bc19277187ff1012c02dd160b33eff54c9d8 (patch) | |
| tree | e07b2335ecd558524ae5950bd887608e5db7499d /src | |
| parent | 4418d46470344a36312c44ed1c6a680d89b15456 (diff) | |
| download | rabbitmq-server-git-4dd0bc19277187ff1012c02dd160b33eff54c9d8.tar.gz | |
Adds info_all/4 for dynamic listing of bindings.
References #62
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_binding.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index 77a9277c4a..c44575f2bb 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -22,7 +22,7 @@ list_for_source_and_destination/2]). -export([new_deletions/0, combine_deletions/2, add_deletion/3, process_deletions/1]). --export([info_keys/0, info/1, info/2, info_all/1, info_all/2]). +-export([info_keys/0, info/1, info/2, info_all/1, info_all/2, info_all/4]). %% these must all be run inside a mnesia tx -export([has_for_source/1, remove_for_source/1, remove_for_destination/2, remove_transient_for_destination/1]). @@ -78,6 +78,8 @@ -spec(info_all/1 :: (rabbit_types:vhost()) -> [rabbit_types:infos()]). -spec(info_all/2 ::(rabbit_types:vhost(), rabbit_types:info_keys()) -> [rabbit_types:infos()]). +-spec(info_all/4 ::(rabbit_types:vhost(), rabbit_types:info_keys(), + reference(), pid()) -> 'ok'). -spec(has_for_source/1 :: (rabbit_types:binding_source()) -> boolean()). -spec(remove_for_source/1 :: (rabbit_types:binding_source()) -> bindings()). -spec(remove_for_destination/2 :: @@ -284,6 +286,11 @@ info_all(VHostPath) -> map(VHostPath, fun (B) -> info(B) end). info_all(VHostPath, Items) -> map(VHostPath, fun (B) -> info(B, Items) end). +info_all(VHostPath, Items, Ref, Pid) -> + map(VHostPath, fun (B) -> Pid ! {Ref, info(B, Items)} end), + Pid ! {Ref, finished}, + ok. + has_for_source(SrcName) -> Match = #route{binding = #binding{source = SrcName, _ = '_'}}, %% we need to check for semi-durable routes (which subsumes |
