Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
AnyEvent::Worker::PoolUser Contributed Perl DocumentaAnyEvent::Worker::Pool(3)

NAME
       AnyEvent::Worker::Pool -	Easily create a	pool of	workers	and use'em
       like a single worker

SYNOPSIS
	   use AnyEvent	5;
	   use AnyEvent::Worker::Pool;

	   # Create a pool of 2	workers
	   my $workers = AnyEvent::Worker::Pool->new( 2, @common_worker_init_args );

	   # Will be run instantly (left 1 idle	worker)
	   $workers->do( @common_worker_do_args	);

	   # Will be run instantly (left 0 idle	workers)
	   $workers->do( @common_worker_do_args	);

	   # Will be run after one of busy worker will get free
	   $workers->do( @common_worker_do_args	);

	   $workers->take_worker(sub {
	       my $worker = shift;
	       $worker->do(@args, sub {
		   $workers>ret_worker($worker);
	       });
	   });

AUTHOR
       Mons Anderson, "<mons@cpan.org>"

COPYRIGHT & LICENSE
       Copyright 2009 Mons Anderson.

       This program is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.24.1			  2011-09-23	     AnyEvent::Worker::Pool(3)

NAME | SYNOPSIS | AUTHOR | COPYRIGHT & LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=AnyEvent::Worker::Pool&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help