better version of the __DIE__ workaround

This commit is contained in:
Oliver Gorwits
2013-01-02 18:20:58 +00:00
parent 9cb897c385
commit 6f5be5948b

View File

@@ -60,7 +60,10 @@ sub worker_factory {
return sub {
my $self = shift;
Role::Tiny->apply_roles_to_object($self, "App::Netdisco::Daemon::Worker::$role");
$SIG{__DIE__} = sub { return @_ if $^S eq 1; $SIG{__DIE__}->(@_) };
# XXX temporary hack to work around MCE's use of __DIE__
my $mce_die = $SIG{__DIE__};
$SIG{__DIE__} = sub { return @_ if $^S and $^S eq 1; $mce_die->(@_) };
# XXX "there's nothing so permanent as temporary..." ~~ Milton Friedman
$self->worker_begin if $self->can('worker_begin');
};
}