[libanyevent-rabbitmq-perl] 65/151: Avoid (more) errors on shutdown

Damyan Ivanov dmn at moszumanska.debian.org
Thu Jan 16 11:03:04 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 d32a40d50d01cba05a60befa4e1cdc3cc3295074
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Tue Sep 28 11:26:19 2010 +0100

    Avoid (more) errors on shutdown
---
 Changes                  | 1 +
 Makefile.PL              | 3 +++
 lib/AnyEvent/RabbitMQ.pm | 5 ++++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Changes b/Changes
index 8dc43d2..2456722 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 Revision history for Perl extension RabbitFoot
 
+        - Avoid (additional) issues when in global destruction.
         - Do not set reply_to to an empty string in the header frame.
 
 1.02    Wed Jun 30 11:35:32 2010
diff --git a/Makefile.PL b/Makefile.PL
index c868e05..744778a 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -16,6 +16,9 @@ requires 'Coro';
 requires 'Coro::AnyEvent';
 requires 'File::ShareDir';
 
+requires 'Devel::GlobalDestruction';
+requires 'namespace::clean';
+
 tests 't/*.t';
 author_tests 'xt';
 install_share;
diff --git a/lib/AnyEvent/RabbitMQ.pm b/lib/AnyEvent/RabbitMQ.pm
index 6c92164..0456119 100644
--- a/lib/AnyEvent/RabbitMQ.pm
+++ b/lib/AnyEvent/RabbitMQ.pm
@@ -16,6 +16,9 @@ use Net::AMQP::Common qw(:all);
 use AnyEvent::RabbitMQ::Channel;
 use AnyEvent::RabbitMQ::LocalQueue;
 
+use Devel::GlobalDestruction;
+use namespace::clean;
+
 our $VERSION = '1.02';
 
 sub new {
@@ -454,7 +457,7 @@ sub _set_cbs {
     my %args = @_;
 
     $args{on_success} ||= sub {};
-    $args{on_failure} ||= sub {die @_};
+    $args{on_failure} ||= sub { return if in_global_destruction; die @_};
 
     return %args;
 }

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