diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-06-02 15:32:33 +0100 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-06-02 15:32:33 +0100 |
commit | 3b57619d1e4b2ed349390f82e68ba8ae2517c425 (patch) | |
tree | 9d388f5e87f084f3c688bb64322b5839c6eb726c | |
parent | 8dada8a4ccb33e7a36ac3c1592379ae4ac904df4 (diff) | |
download | rabbitmq-server-3b57619d1e4b2ed349390f82e68ba8ae2517c425.tar.gz |
Reduce diff from bug23554: Scaffolding for programmatically deciding backing queue
-rw-r--r-- | src/rabbit_amqqueue_process.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl index 8091e2c2..f7b710a4 100644 --- a/src/rabbit_amqqueue_process.erl +++ b/src/rabbit_amqqueue_process.erl @@ -97,12 +97,11 @@ info_keys() -> ?INFO_KEYS. init(Q) -> ?LOGDEBUG("Queue starting - ~p~n", [Q]), process_flag(trap_exit, true), - {ok, BQ} = application:get_env(backing_queue_module), {ok, #q{q = Q#amqqueue{pid = self()}, exclusive_consumer = none, has_had_consumers = false, - backing_queue = BQ, + backing_queue = backing_queue_module(Q), backing_queue_state = undefined, active_consumers = queue:new(), blocked_consumers = queue:new(), @@ -226,6 +225,10 @@ next_state(State = #q{backing_queue = BQ, backing_queue_state = BQS}) -> timed -> {ensure_sync_timer(State1), 0 } end. +backing_queue_module(#amqqueue{}) -> + {ok, BQM} = application:get_env(backing_queue_module), + BQM. + ensure_sync_timer(State = #q{sync_timer_ref = undefined}) -> {ok, TRef} = timer:apply_after( ?SYNC_INTERVAL, rabbit_amqqueue, sync_timeout, [self()]), |