summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Joubert <emile@rabbitmq.com>2012-11-23 14:25:56 +0000
committerEmile Joubert <emile@rabbitmq.com>2012-11-23 14:25:56 +0000
commite6b612d8265e81363cee4152c54aa4b0354380af (patch)
tree6b3298aebbde09711366a2ba6b4116c7a41c1129
parent0e455cb23ccc8045361b9769f5fbf378254b4013 (diff)
downloadrabbitmq-server-e6b612d8265e81363cee4152c54aa4b0354380af.tar.gz
Better type signature
...and rollback amqqueue_process changes
-rw-r--r--src/rabbit_amqqueue_process.erl5
-rw-r--r--src/rabbit_backing_queue.erl5
2 files changed, 3 insertions, 7 deletions
diff --git a/src/rabbit_amqqueue_process.erl b/src/rabbit_amqqueue_process.erl
index 743d72ef..b3c44a50 100644
--- a/src/rabbit_amqqueue_process.erl
+++ b/src/rabbit_amqqueue_process.erl
@@ -1154,11 +1154,6 @@ handle_call({requeue, AckTags, ChPid}, From, State) ->
gen_server2:reply(From, ok),
noreply(requeue(AckTags, ChPid, State));
-handle_call({fold, Fun, Acc}, _From, State = #q{backing_queue = BQ,
- backing_queue_state = BQS}) ->
- {Reply, BQS1} = BQ:fold(Fun, Acc, BQS),
- reply(Reply, State #q{backing_queue_state = BQS1});
-
handle_call(start_mirroring, _From, State = #q{backing_queue = BQ,
backing_queue_state = BQS}) ->
%% lookup again to get policy for init_with_existing_bq
diff --git a/src/rabbit_backing_queue.erl b/src/rabbit_backing_queue.erl
index f0d0b46c..e9c014be 100644
--- a/src/rabbit_backing_queue.erl
+++ b/src/rabbit_backing_queue.erl
@@ -23,6 +23,7 @@
%% We can't specify a per-queue ack/state with callback signatures
-type(ack() :: any()).
-type(state() :: any()).
+-type(acc() :: any()).
-type(msg_ids() :: [rabbit_types:msg_id()]).
-type(fetch_result(Ack) ::
@@ -161,8 +162,8 @@
%% Fold over all the messages in a queue and return the accumulated
%% results, leaving the queue undisturbed.
--callback fold(fun((rabbit_types:basic_message(), any()) -> any()),
- any(), state()) -> {any(), state()}.
+-callback fold(fun((rabbit_types:basic_message(), acc()) -> acc()),
+ acc(), state()) -> {acc(), state()}.
%% How long is my queue?
-callback len(state()) -> non_neg_integer().