NAME
Poe::Wheel::Spawner
DESCRIPTION
Poe::Wheel::Spawner generate only one process for your workload and will add a next one on spawn call in it unless poos_size is not exceeded.
VERSION
Version 0.02
SYNOPSIS
use M43::POE::Wheel::Spawner;
my $foo = M43::POE::Wheel::Spawner->new(
pool_size => 2,
stop_if_done => 1,
workload => sub { _workload() }
);
$foo->run();
sub _workload {
# request for a new sibling
$foo->spawn($$);
# ...
}
SUBROUTINES/METHODS
new(%opts)
options:
pool_size
the number of maximal parallel executed
workloadstop_if_done
stop after
pool_sizepid's are exited.run endless if !
stop_if_doneworkload
CODE reference to execute
run(%opts)
%opts provide to POE::Session
debug
default 0
trace
default 0
create a POE::Session
run POE::Kernel
spawn($pid)
request to spawn
AUTHOR
Alexei Pastuchov <palik at cpan.org>.
REPOSITORY
https://github.com/p-alik/Poe-Wheel-Spawner.git
LICENSE AND COPYRIGHT
Copyright 2014 by Alexei Pastuchov <palik at cpan.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.