Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a75919c2c4
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (23 sloc) 0.542 kb
package Manager;
use Moose;
with qw(MooseX::Workers);
sub worker_stdout {
my ( $self, $output, $job ) = @_;
printf(
"%s(%s,%s) said '%s'\n",
$job->name, $job->ID, $job->PID, $output
);
}
sub run {
foreach (qw( foo bar baz )) {
my $job = MooseX::Workers::Job->new(
name => $_,
command => sub { print "Started\n"; sleep(10); print "Finished\n"; die "horribly" },
timeout => 30,
);
$_[0]->enqueue( $job );
}
POE::Kernel->run();
}
no Moose;
Manager->new()->run();
Jump to Line
Something went wrong with that request. Please try again.