Subject: | Callback on close broken in 1.09 |
The on_success callback when you call ->close was broken in
192b417742ed52ae1656dec325e46059f74d30bb
This commit fixes it,
https://github.com/davel/AnyEvent-
RabbitMQ/commit/cc0dbc39434bcbedf239654a7ca0d1dee1d12180
Subject: | anyevent.patch |
commit cc0dbc39434bcbedf239654a7ca0d1dee1d12180
Author: Dave Lambley <davel@state51.co.uk>
Date: Tue Mar 5 14:49:10 2013 +0000
Ensure the on_success handler gets called on close if there are no channels.
diff --git a/lib/AnyEvent/RabbitMQ.pm b/lib/AnyEvent/RabbitMQ.pm
index eacc7a4..18cd054 100644
--- a/lib/AnyEvent/RabbitMQ.pm
+++ b/lib/AnyEvent/RabbitMQ.pm
@@ -350,6 +350,11 @@ sub close {
}
);
};
+
+ if (scalar(keys %{ $self->{_channels} })==0) {
+ $args{on_success}->(@_);
+ }
+
for my $id (keys %{$self->{_channels}}) {
my $channel = $self->{_channels}->{$id}
or next; # Could have already gone away on global destruction..