summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAyanda Dube <ayanda.dube@erlang-solutions.com>2015-09-08 17:13:34 +0100
committerAyanda Dube <ayanda.dube@erlang-solutions.com>2015-10-07 08:46:41 +0100
commit8320c4d3e477921de62ebe9e5502fec31b8c0455 (patch)
tree68076b4277755c6167822dcbcbbe98f08575fb34 /src
parentc6e9ec2691c117094535329026a1454167e7cfd3 (diff)
downloadrabbitmq-server-git-8320c4d3e477921de62ebe9e5502fec31b8c0455.tar.gz
Adds list_formatted/3 for dynamic display of parameters.
References #62
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_runtime_parameters.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rabbit_runtime_parameters.erl b/src/rabbit_runtime_parameters.erl
index fafd598bb7..910419c0d7 100644
--- a/src/rabbit_runtime_parameters.erl
+++ b/src/rabbit_runtime_parameters.erl
@@ -19,8 +19,8 @@
-include("rabbit.hrl").
-export([parse_set/5, set/5, set_any/5, clear/3, clear_any/3, list/0, list/1,
- list_component/1, list/2, list_formatted/1, lookup/3,
- value/3, value/4, info_keys/0]).
+ list_component/1, list/2, list_formatted/1, list_formatted/3,
+ lookup/3, value/3, value/4, info_keys/0]).
-export([set_global/2, value_global/1, value_global/2]).
@@ -48,6 +48,7 @@
-spec(list/2 :: (rabbit_types:vhost() | '_', binary() | '_')
-> [rabbit_types:infos()]).
-spec(list_formatted/1 :: (rabbit_types:vhost()) -> [rabbit_types:infos()]).
+-spec(list_formatted/3 :: (rabbit_types:vhost(), reference(), pid()) -> 'ok').
-spec(lookup/3 :: (rabbit_types:vhost(), binary(), binary())
-> rabbit_types:infos() | 'not_found').
-spec(value/3 :: (rabbit_types:vhost(), binary(), binary()) -> term()).
@@ -198,6 +199,11 @@ list(VHost, Component) ->
list_formatted(VHost) ->
[pset(value, format(pget(value, P)), P) || P <- list(VHost)].
+list_formatted(VHost, Ref, Pid) ->
+ [Pid ! {Ref, pset(value, format(pget(value, P)), P)} || P <- list(VHost)],
+ Pid ! {Ref, finished},
+ ok.
+
lookup(VHost, Component, Name) ->
case lookup0({VHost, Component, Name}, rabbit_misc:const(not_found)) of
not_found -> not_found;