Broker::Async::Worker
Used by Broker::Async for tracking the state of asynchronous work.
The code reference used to start the work. This will be invoked with the arguments passed to do.
do
Must return a Future subclass.
The number of concurrent tasks a worker can execute. Do'ing more tasks than this limit is a fatal error.
Defaults to 1.
my $worker = Broker::Async::Worker->new( code => sub { ... }, concurrency => $max, );
Indicates whether the worker is available to do tasks. It is a fatal error to invoke do when this is false.
my $future = $worker->do($task);
Invokes the code attribute with the given arguments. Returns a future that will be resolved when the work is done.
Mark Flickinger <maf@cpan.org>
This software is licensed under the same terms as Perl itself.
To install Broker::Async, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Broker::Async
CPAN shell
perl -MCPAN -e shell install Broker::Async
For more information on module installation, please visit the detailed CPAN module installation guide.