diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2011-06-25 18:23:20 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-06-25 18:23:20 +0100 |
commit | de668242d321f4ce7d186f7cfa2ce67a5813c878 (patch) | |
tree | 0b387ee7e0c1eef9e7a9f6aa4312fd057a38f72f | |
parent | 837bbfce10e9ea2fdcb64cab40a9e43a72c5db79 (diff) | |
download | rabbitmq-server-de668242d321f4ce7d186f7cfa2ce67a5813c878.tar.gz |
get rid of sync run_backing_queue
it was only needed for tx
Also remove some tx remnants from mirror_queue_slave.
-rw-r--r-- | src/rabbit_amqqueue.erl | 9 | ||||
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 7 | ||||
-rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 15 |
3 files changed, 4 insertions, 27 deletions
diff --git a/src/rabbit_amqqueue.erl b/src/rabbit_amqqueue.erl index 4d6aaa18..d9101bb1 100644 --- a/src/rabbit_amqqueue.erl +++ b/src/rabbit_amqqueue.erl @@ -31,8 +31,7 @@ %% internal --export([internal_declare/2, internal_delete/1, - run_backing_queue/3, run_backing_queue_async/3, +-export([internal_declare/2, internal_delete/1, 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]). @@ -140,9 +139,6 @@ rabbit_types:connection_exit() | fun (() -> rabbit_types:ok_or_error('not_found') | rabbit_types:connection_exit())). --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'). @@ -487,9 +483,6 @@ internal_delete(QueueName) -> end end). -run_backing_queue(QPid, Mod, Fun) -> - gen_server2:call(QPid, {run_backing_queue, Mod, Fun}, infinity). - run_backing_queue_async(QPid, Mod, Fun) -> gen_server2:cast(QPid, {run_backing_queue, Mod, Fun}). diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 87cdf925..28e0db87 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -787,7 +787,6 @@ prioritise_call(Msg, _From, _State) -> info -> 9; {info, _Items} -> 9; consumers -> 9; - {run_backing_queue, _Mod, _Fun} -> 6; _ -> 0 end. @@ -1011,11 +1010,7 @@ handle_call({requeue, AckTags, ChPid}, From, State) -> ChAckTags1 = subtract_acks(ChAckTags, AckTags), maybe_store_ch_record(C#cr{acktags = ChAckTags1}), noreply(requeue_and_run(AckTags, State)) - end; - -handle_call({run_backing_queue, Mod, Fun}, _From, State) -> - reply(ok, run_backing_queue(Mod, Fun, State)). - + end. handle_cast({run_backing_queue, Mod, Fun}, State) -> noreply(run_backing_queue(Mod, Fun, State)); diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 66ff575f..03a0dbbe 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -167,14 +167,7 @@ handle_call({gm_deaths, Deaths}, From, {error, not_found} -> gen_server2:reply(From, ok), {stop, normal, State} - end; - -handle_call({run_backing_queue, Mod, Fun}, _From, State) -> - reply(ok, run_backing_queue(Mod, Fun, State)); - -handle_call({commit, _Txn, _ChPid}, _From, State) -> - %% We don't support transactions in mirror queues - reply(ok, State). + end. handle_cast({run_backing_queue, Mod, Fun}, State) -> noreply(run_backing_queue(Mod, Fun, State)); @@ -208,11 +201,7 @@ handle_cast(update_ram_duration, handle_cast(sync_timeout, State) -> noreply(backing_queue_timeout( - State #state { sync_timer_ref = undefined })); - -handle_cast({rollback, _Txn, _ChPid}, State) -> - %% We don't support transactions in mirror queues - noreply(State). + State #state { sync_timer_ref = undefined })). handle_info(timeout, State) -> noreply(backing_queue_timeout(State)); |