GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
AnyEvent::Worker::Pool(3) User Contributed Perl Documentation AnyEvent::Worker::Pool(3)

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

    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);
        });
    });

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

Copyright 2009 Mons Anderson.

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

2011-09-23 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.