ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-Fork-Pool/Pool.pm
(Generate patch)

Comparing AnyEvent-Fork-Pool/Pool.pm (file contents):
Revision 1.9 by root, Thu Apr 25 00:27:22 2013 UTC vs.
Revision 1.10 by root, Thu Apr 25 01:21:18 2013 UTC

537deems this useful. For example, after executing a job, one could check 537deems this useful. For example, after executing a job, one could check
538the process size or the number of jobs handled so far, and if either is 538the process size or the number of jobs handled so far, and if either is
539too high, the worker could ask to get retired, to avoid memory leaks to 539too high, the worker could ask to get retired, to avoid memory leaks to
540accumulate. 540accumulate.
541 541
542Example: retire a worker after it has handled roughly 100 requests.
543
544 my $count = 0;
545
546 sub my::worker {
547
548 ++$count == 100
549 and AnyEvent::Fork::Pool::retire ();
550
551 ... normal code goes here
552 }
553
542=back 554=back
543 555
544=head1 POOL PARAMETERS RECIPES 556=head1 POOL PARAMETERS RECIPES
545 557
546This section describes some recipes for pool paramaters. These are mostly 558This section describes some recipes for pool paramaters. These are mostly

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines