summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-08-21 15:25:46 +0100
committerSimon MacMullen <simon@rabbitmq.com>2013-08-21 15:25:46 +0100
commit9ca20c84888e90ba06ff99eb5440d48198b9312a (patch)
treecab6ced42a4fa9e1a638aaeffb2fcb4670f0e0f0 /src
parentbb5b1540d9680eb39d5d1cd0f668b8c1c6708b01 (diff)
downloadrabbitmq-server-git-9ca20c84888e90ba06ff99eb5440d48198b9312a.tar.gz
Rename notification_requested to refresh, and emit queue_empty rather than queue_run_finished - we don't care if the queue run has finished and we are not empty, but we *do* care if we have become empty by some other method (purge, TTL).
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_amqqueue_process.erl6
-rw-r--r--src/rabbit_queue_decorator.erl4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index b15c914923..3167ffe5ae 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -441,7 +441,8 @@ is_ch_blocked(#cr{unsent_message_count = Count, limiter = Limiter}) ->
maybe_send_drained(WasEmpty, State) ->
case (not WasEmpty) andalso is_empty(State) of
- true -> [send_drained(C) || C <- all_ch_record()];
+ true -> notify_decorators(queue_empty, [], State),
+ [send_drained(C) || C <- all_ch_record()];
false -> ok
end,
State.
@@ -560,7 +561,6 @@ run_message_queue(State) ->
{_IsEmpty1, State1} = deliver_msgs_to_consumers(
fun deliver_from_queue_deliver/2,
is_empty(State), State),
- notify_decorators(queue_run_finished, [], State1),
State1.
add_consumer({ChPid, Consumer = #consumer{args = Args}}, ActiveConsumers) ->
@@ -1422,7 +1422,7 @@ handle_cast({credit, ChPid, CTag, Credit, Drain},
end);
handle_cast(notify_decorators, State) ->
- notify_decorators(notification_requested, [], State),
+ notify_decorators(refresh, [], State),
noreply(State);
handle_cast(wake_up, State) ->
diff --git a/src/rabbit_queue_decorator.erl b/src/rabbit_queue_decorator.erl
index a0d0cca549..8f6375a504 100644
--- a/src/rabbit_queue_decorator.erl
+++ b/src/rabbit_queue_decorator.erl
@@ -10,10 +10,10 @@
-type(notify_event() :: 'consumer_blocked' |
'consumer_unblocked' |
- 'queue_run_finished' |
+ 'queue_empty' |
'basic_consume' |
'basic_cancel' |
- 'notification_requested').
+ 'refresh').
-callback startup(rabbit_types:amqqueue()) -> 'ok'.