1 | =head1 NAME |
1 | =head1 NAME |
2 | |
2 | |
3 | AnyEvent::Fork::Pool - simple process pool manager on top of AnyEvent::Fork |
3 | AnyEvent::Fork::Pool - simple process pool manager on top of AnyEvent::Fork |
4 | |
|
|
5 | THE API IS NOT FINISHED, CONSIDER THIS AN ALPHA RELEASE |
|
|
6 | |
4 | |
7 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
8 | |
6 | |
9 | use AnyEvent; |
7 | use AnyEvent; |
10 | use AnyEvent::Fork::Pool; |
8 | use AnyEvent::Fork::Pool; |
… | |
… | |
43 | |
41 | |
44 | $finish->recv; |
42 | $finish->recv; |
45 | |
43 | |
46 | =head1 DESCRIPTION |
44 | =head1 DESCRIPTION |
47 | |
45 | |
48 | This module uses processes created via L<AnyEvent::Fork> and the RPC |
46 | This module uses processes created via L<AnyEvent::Fork> (or |
49 | protocol implement in L<AnyEvent::Fork::RPC> to create a load-balanced |
47 | L<AnyEvent::Fork::Remote>) and the RPC protocol implement in |
50 | pool of processes that handles jobs. |
48 | L<AnyEvent::Fork::RPC> to create a load-balanced pool of processes that |
|
|
49 | handles jobs. |
51 | |
50 | |
52 | Understanding of L<AnyEvent::Fork> is helpful but not critical to be able |
51 | Understanding of L<AnyEvent::Fork> is helpful but not critical to be able |
53 | to use this module, but a thorough understanding of L<AnyEvent::Fork::RPC> |
52 | to use this module, but a thorough understanding of L<AnyEvent::Fork::RPC> |
54 | is, as it defines the actual API that needs to be implemented in the |
53 | is, as it defines the actual API that needs to be implemented in the |
55 | worker processes. |
54 | worker processes. |
56 | |
|
|
57 | =head1 EXAMPLES |
|
|
58 | |
55 | |
59 | =head1 PARENT USAGE |
56 | =head1 PARENT USAGE |
60 | |
57 | |
61 | To create a pool, you first have to create a L<AnyEvent::Fork> object - |
58 | To create a pool, you first have to create a L<AnyEvent::Fork> object - |
62 | this object becomes your template process. Whenever a new worker process |
59 | this object becomes your template process. Whenever a new worker process |