first pass at Interactive worker

This commit is contained in:
Oliver Gorwits
2013-01-02 19:38:28 +00:00
parent b96b27b604
commit b3cd1a55e5
5 changed files with 34 additions and 71 deletions

View File

@@ -59,11 +59,16 @@ sub worker_factory {
my $role = shift;
return sub {
my $self = shift;
# my $wid = $self->wid;
# $self->sendto('stderr', ">>> worker $wid starting with role $role\n");
Role::Tiny->apply_roles_to_object($self, "App::Netdisco::Daemon::Worker::$role");
# 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');
};
}