Skip to content

Commit

Permalink
Avoid (more) errors on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Dec 14, 2010
1 parent db4c9d5 commit d32a40d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions 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
Expand Down
3 changes: 3 additions & 0 deletions Makefile.PL
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion lib/AnyEvent/RabbitMQ.pm
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d32a40d

Please sign in to comment.