summaryrefslogtreecommitdiff
path: root/src/rabbit_binding.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2011-03-23 14:11:09 +0000
committerSimon MacMullen <simon@rabbitmq.com>2011-03-23 14:11:09 +0000
commitfe150f5c5607dbda654074553000af2310d0a7e2 (patch)
tree848f345dfbcea99eee057231bdc410030d6cb05c /src/rabbit_binding.erl
parent05eb5fa6fff022148051b28c16744b82be982589 (diff)
downloadrabbitmq-server-fe150f5c5607dbda654074553000af2310d0a7e2.tar.gz
Do an impersonation of the serialisation thing for create / delete. Since the counter resets after delete this doesn't solve the problem but it makes the API cleaner and maybe future-proof.
Diffstat (limited to 'src/rabbit_binding.erl')
-rw-r--r--src/rabbit_binding.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl
index d363e342..33525e07 100644
--- a/src/rabbit_binding.erl
+++ b/src/rabbit_binding.erl
@@ -415,7 +415,10 @@ process_deletions(Deletions, transaction) ->
pd_callback(transaction, remove_bindings, X, Bindings),
dict:store(X, serial(X), Acc)
end,
- fun rabbit_misc:const_ok/1,
+ fun (X, Bindings, Acc) ->
+ pd_callback(transaction, delete, X, Bindings),
+ dict:store(X, serial(X), Acc)
+ end,
Deletions, dict:new(), true);
process_deletions(Deletions, Serials) ->
@@ -424,8 +427,10 @@ process_deletions(Deletions, Serials) ->
pd_callback(dict:fetch(X, Serials), remove_bindings, X, Bindings),
Acc
end,
- fun (X) ->
- rabbit_event:notify(exchange_deleted, [{name, X#exchange.name}])
+ fun (X, Bindings, Acc) ->
+ pd_callback(dict:fetch(X, Serials), delete, X, Bindings),
+ rabbit_event:notify(exchange_deleted, [{name, X#exchange.name}]),
+ Acc
end,
Deletions, ok, false).
@@ -439,9 +444,7 @@ process_deletions(NotDeletedFun, DeletedFun, Deletions, Acc0, Tx) ->
not_deleted ->
NotDeletedFun(X, FlatBindings, Acc);
deleted ->
- DeletedFun(X),
- pd_callback(Tx, delete, X, Bindings),
- Acc
+ DeletedFun(X, FlatBindings, Acc)
end
end, Acc0, Deletions).