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


Manual Reference Pages  -  ANYEVENT::WORKER::POOL (3)

.ds Aq ’

NAME

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

CONTENTS

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.

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


perl v5.20.3 ANYEVENT::WORKER::POOL (3) 2011-09-23

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