diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-08-01 15:01:06 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-08-01 15:01:06 +0100 |
commit | 0798dfad95793219c5ee53b81decbc451252e636 (patch) | |
tree | 9b5992eab7404cacc1dc853c5e1b552465f31bff /src/rabbit_amqqueue.erl | |
parent | e2c57c78fcc0281eeb78dd1914287e539265244c (diff) | |
download | rabbitmq-server-0798dfad95793219c5ee53b81decbc451252e636.tar.gz |
Introduce rabbit:force_event_refresh which will:
* Emit a foo_exists for every foo that can emit foo_created
* As a side effect, wake everything up and thus send out foo_stats events too.
Currently this doesn't work for direct connections (rather more fiddly), but it does for everything else.
Diffstat (limited to 'src/rabbit_amqqueue.erl')
-rw-r--r-- | src/rabbit_amqqueue.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index e9d01d12..c5e2f908 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -22,6 +22,7 @@ check_exclusive_access/2, with_exclusive_access_or_die/3, stat/1, deliver/2, requeue/3, ack/3, reject/4]). -export([list/1, info_keys/0, info/1, info/2, info_all/1, info_all/2]). +-export([force_event_refresh/0]). -export([consumers/1, consumers_all/1, consumer_info_keys/0]). -export([basic_get/3, basic_consume/7, basic_cancel/4]). -export([notify_sent/2, unblock/2, flush_all/2]). @@ -90,6 +91,7 @@ -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(force_event_refresh/0 :: () -> 'ok'). -spec(consumers/1 :: (rabbit_types:amqqueue()) -> [{pid(), rabbit_types:ctag(), boolean()}]). @@ -387,6 +389,11 @@ info_all(VHostPath) -> map(VHostPath, fun (Q) -> info(Q) end). info_all(VHostPath, Items) -> map(VHostPath, fun (Q) -> info(Q, Items) end). +force_event_refresh() -> + [map(VHost, fun(Q) -> delegate_cast(Q#amqqueue.pid, + force_event_refresh) end) || + VHost <- rabbit_vhost:list()]. + consumers(#amqqueue{ pid = QPid }) -> delegate_call(QPid, consumers). |