diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-03-14 16:54:23 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-03-14 16:54:23 +0000 |
commit | b6f5d1dcd1e9465f84a4374ecdece7a37f51504b (patch) | |
tree | 7a55815d85b837a317a9e6b528461708c315b4ec /src/rabbit_amqqueue.erl | |
parent | 279e858cac439e493fe3990a4ef0ef689a0ff29b (diff) | |
parent | 80854415c2e1579d52127b9722c985c77d0791e4 (diff) | |
download | rabbitmq-server-b6f5d1dcd1e9465f84a4374ecdece7a37f51504b.tar.gz |
merge default into bug23554
Diffstat (limited to 'src/rabbit_amqqueue.erl')
-rw-r--r-- | src/rabbit_amqqueue.erl | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 36b1662e..9820567c 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -17,17 +17,11 @@ -module(rabbit_amqqueue). -export([start/0, stop/0, declare/5, delete_immediately/1, delete/3, purge/1]). --export([internal_declare/2, internal_delete/1, - maybe_run_queue_via_backing_queue/3, - maybe_run_queue_via_backing_queue_async/3, - sync_timeout/1, update_ram_duration/1, set_ram_duration_target/2, - set_maximum_since_use/2, maybe_expire/1, drop_expired/1]). -export([pseudo_queue/2]). -export([lookup/1, with/2, with_or_die/2, assert_equivalence/5, check_exclusive_access/2, with_exclusive_access_or_die/3, stat/1, deliver/2, requeue/3, ack/4, reject/4]). -export([list/1, info_keys/0, info/1, info/2, info_all/1, info_all/2]). --export([emit_stats/1]). -export([consumers/1, consumers_all/1]). -export([basic_get/3, basic_consume/7, basic_cancel/4]). -export([notify_sent/2, unblock/2, flush_all/2]). @@ -35,6 +29,14 @@ -export([on_node_down/1]). -export([store_queue/1]). + +%% internal +-export([internal_declare/2, internal_delete/1, + run_backing_queue/3, run_backing_queue_async/3, + sync_timeout/1, update_ram_duration/1, set_ram_duration_target/2, + set_maximum_since_use/2, maybe_expire/1, drop_expired/1, + emit_stats/1]). + -include("rabbit.hrl"). -include_lib("stdlib/include/qlc.hrl"). @@ -141,10 +143,12 @@ rabbit_types:connection_exit() | fun ((boolean()) -> rabbit_types:ok_or_error('not_found') | rabbit_types:connection_exit())). --spec(maybe_run_queue_via_backing_queue/3 :: - (pid(), atom(), (fun ((A) -> {[rabbit_guid:msg_id()], A}))) -> 'ok'). --spec(maybe_run_queue_via_backing_queue_async/3 :: - (pid(), atom(), (fun ((A) -> {[rabbit_guid:msg_id()], A}))) -> 'ok'). +-spec(run_backing_queue/3 :: + (pid(), atom(), + (fun ((atom(), A) -> {[rabbit_types:msg_id()], A}))) -> 'ok'). +-spec(run_backing_queue_async/3 :: + (pid(), atom(), + (fun ((atom(), A) -> {[rabbit_types:msg_id()], A}))) -> 'ok'). -spec(sync_timeout/1 :: (pid()) -> 'ok'). -spec(update_ram_duration/1 :: (pid()) -> 'ok'). -spec(set_ram_duration_target/2 :: (pid(), number() | 'infinity') -> 'ok'). @@ -440,13 +444,11 @@ internal_delete(QueueName) -> end end). +run_backing_queue(QPid, Mod, Fun) -> + gen_server2:call(QPid, {run_backing_queue, Mod, Fun}, infinity). -maybe_run_queue_via_backing_queue(QPid, Mod, Fun) -> - gen_server2:call(QPid, {maybe_run_queue_via_backing_queue, Mod, Fun}, - infinity). - -maybe_run_queue_via_backing_queue_async(QPid, Mod, Fun) -> - gen_server2:cast(QPid, {maybe_run_queue_via_backing_queue, Mod, Fun}). +run_backing_queue_async(QPid, Mod, Fun) -> + gen_server2:cast(QPid, {run_backing_queue, Mod, Fun}). sync_timeout(QPid) -> gen_server2:cast(QPid, sync_timeout). |