[libanyevent-rabbitmq-perl] 136/151: Ensure the on_success handler gets called on close if there are no channels.

Damyan Ivanov dmn at moszumanska.debian.org
Thu Jan 16 11:03:10 UTC 2014


This is an automated email from the git hooks/post-receive script.

dmn pushed a commit to annotated tag debian/1.12-1
in repository libanyevent-rabbitmq-perl.

commit cc0dbc39434bcbedf239654a7ca0d1dee1d12180
Author: Dave Lambley <davel at 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.
---
 lib/AnyEvent/RabbitMQ.pm | 5 +++++
 1 file changed, 5 insertions(+)

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..

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libanyevent-rabbitmq-perl.git



More information about the Pkg-perl-cvs-commits mailing list