diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-20 14:32:16 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-20 14:32:16 +0100 |
commit | a749a8f513b881ff35f1de0e225b58aa6575460f (patch) | |
tree | bfe039bec55637df8014a72c80cc0f62757cf4ce | |
parent | 2e2d327c233a4116d13eee26792fba2f365e0e8e (diff) | |
download | rabbitmq-server-a749a8f513b881ff35f1de0e225b58aa6575460f.tar.gz |
BQ:idle_timeout => BQ:timeout
-rw-r--r-- | src/rabbit_mirror_queue_master.erl | 10 | ||||
-rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/rabbit_mirror_queue_master.erl b/src/rabbit_mirror_queue_master.erl index f54c8c37..e973ea78 100644 --- a/src/rabbit_mirror_queue_master.erl +++ b/src/rabbit_mirror_queue_master.erl @@ -21,7 +21,7 @@ tx_publish/5, tx_ack/3, tx_rollback/2, tx_commit/4, requeue/3, len/1, is_empty/1, drain_confirmed/1, dropwhile/2, set_ram_duration_target/2, ram_duration/1, - needs_idle_timeout/1, idle_timeout/1, handle_pre_hibernate/1, + needs_timeout/1, timeout/1, handle_pre_hibernate/1, status/1, invoke/3, is_duplicate/3, discard/3]). -export([start/1, stop/0]). @@ -252,11 +252,11 @@ ram_duration(State = #state { backing_queue = BQ, backing_queue_state = BQS}) -> {Result, BQS1} = BQ:ram_duration(BQS), {Result, State #state { backing_queue_state = BQS1 }}. -needs_idle_timeout(#state { backing_queue = BQ, backing_queue_state = BQS}) -> - BQ:needs_idle_timeout(BQS). +needs_timeout(#state { backing_queue = BQ, backing_queue_state = BQS}) -> + BQ:needs_timeout(BQS). -idle_timeout(State = #state { backing_queue = BQ, backing_queue_state = BQS}) -> - State #state { backing_queue_state = BQ:idle_timeout(BQS) }. +timeout(State = #state { backing_queue = BQ, backing_queue_state = BQS}) -> + State #state { backing_queue_state = BQ:timeout(BQS) }. handle_pre_hibernate(State = #state { backing_queue = BQ, backing_queue_state = BQS}) -> diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index fc50c932..46020271 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -205,7 +205,7 @@ handle_cast(update_ram_duration, backing_queue_state = BQS2 }); handle_cast(sync_timeout, State) -> - noreply(backing_queue_idle_timeout( + noreply(backing_queue_timeout( State #state { sync_timer_ref = undefined })); handle_cast({rollback, _Txn, _ChPid}, State) -> @@ -213,7 +213,7 @@ handle_cast({rollback, _Txn, _ChPid}, State) -> noreply(State). handle_info(timeout, State) -> - noreply(backing_queue_idle_timeout(State)); + noreply(backing_queue_timeout(State)); handle_info({'DOWN', _MonitorRef, process, Pid, _Reason}, State = #state { gm = GM }) -> @@ -499,13 +499,13 @@ next_state(State = #state{backing_queue = BQ, backing_queue_state = BQS}) -> State1 = ensure_rate_timer( confirm_messages(MsgIds, State #state { backing_queue_state = BQS1 })), - case BQ:needs_idle_timeout(BQS1) of + case BQ:needs_timeout(BQS1) of true -> {ensure_sync_timer(State1), 0}; false -> {stop_sync_timer(State1), hibernate} end. -backing_queue_idle_timeout(State = #state { backing_queue = BQ }) -> - run_backing_queue(BQ, fun (M, BQS) -> M:idle_timeout(BQS) end, State). +backing_queue_timeout(State = #state { backing_queue = BQ }) -> + run_backing_queue(BQ, fun (M, BQS) -> M:timeout(BQS) end, State). ensure_sync_timer(State = #state { sync_timer_ref = undefined }) -> {ok, TRef} = timer:apply_after( |