diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2010-06-24 19:53:53 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-06-24 19:53:53 +0100 |
| commit | 9b774d7f15c1571743fde8cd2fbb18cb917d1b84 (patch) | |
| tree | b86da599bae80da7511df4b5518122645ce29825 /src | |
| parent | 9e9aa7733a67e05ca913d31785fd5395e1112d08 (diff) | |
| download | rabbitmq-server-git-9b774d7f15c1571743fde8cd2fbb18cb917d1b84.tar.gz | |
refactor: don't use module:Fun
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_variable_queue.erl | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index e4a81311e1..712ebf84d3 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -509,7 +509,9 @@ fetch(AckRequired, State = #vqstate { q4 = Q4, end. ack(AckTags, State) -> - a(ack(remove, fun (_AckEntry, State1) -> State1 end, AckTags, State)). + a(ack(fun rabbit_msg_store:remove/2, + fun (_AckEntry, State1) -> State1 end, + AckTags, State)). tx_publish(Txn, Msg = #basic_message { is_persistent = IsPersistent }, State = #vqstate { durable = IsDurable, @@ -561,7 +563,7 @@ tx_commit(Txn, Fun, State = #vqstate { durable = IsDurable }) -> requeue(AckTags, State) -> a(reduce_memory_use( - ack(release, + ack(fun rabbit_msg_store:release/2, fun (#msg_status { msg = Msg }, State1) -> {_SeqId, State2} = publish(Msg, true, false, State1), State2; @@ -572,7 +574,8 @@ requeue(AckTags, State) -> State2 = State1 #vqstate { msg_store_clients = MSCState1 }, {_SeqId, State3} = publish(Msg, true, true, State2), State3 - end, AckTags, State))). + end, + AckTags, State))). len(#vqstate { len = Len }) -> Len. @@ -848,10 +851,9 @@ beta_fold(Fun, Init, Q) -> %% Internal major helpers for Public API %%---------------------------------------------------------------------------- -ack(_ReleaseOrRemove, _Fun, [], State) -> +ack(_MsgStoreFun, _Fun, [], State) -> State; -ack(ReleaseOrRemove, Fun, AckTags, State) when ReleaseOrRemove =:= remove orelse - ReleaseOrRemove =:= release -> +ack(MsgStoreFun, Fun, AckTags, State) -> {{SeqIds, GuidsByStore}, State1 = #vqstate { index_state = IndexState, persistent_count = PCount }} = lists:foldl( @@ -869,7 +871,7 @@ ack(ReleaseOrRemove, Fun, AckTags, State) when ReleaseOrRemove =:= remove orelse end, {{[], dict:new()}, State}, AckTags), IndexState1 = rabbit_queue_index:ack(SeqIds, IndexState), ok = dict:fold(fun (MsgStore, Guids, ok) -> - rabbit_msg_store:ReleaseOrRemove(MsgStore, Guids) + MsgStoreFun(MsgStore, Guids) end, ok, GuidsByStore), PCount1 = PCount - case dict:find(?PERSISTENT_MSG_STORE, GuidsByStore) of error -> 0; |
