NAME
Forks::Super::Deferred - manage queue of background tasks to perform
VERSION
0.97
DESCRIPTION
Forks::Super::Deferred
is part of the Forks::Super distribution. The function and variables in this module manage the queue of "deferred processes" -- background tasks that have been specified but that can not or should not be run until some time in the future.
There should not be much reason for a Forks::Super user to call functions or manipulate variables in this module directly.
This package used to be called Forks::Super::Queue
, but that name is being made available for an object/task queue implementation that can work across parent-child process boundaries.
FUNCTIONS
- Forks::Super::Deferred::check_queue
-
Examines the queue of background tasks. Launches the tasks that are eligible to start.
This function is called automatically from your program during
wait
andwaitpid
calls, when theSIGCHLD
handler runs, or during any "productive pause" (see "pause" in Forks::Super::Util) in your code.
VARIABLES
- $Forks::Super::Deferred::QUEUE_MONITOR_FREQ
-
When jobs are in the queue, a separate thread will signal the program and cause the queue to be examined every
$QUEUE_MONITOR_FREQ
seconds.For programs with lots of quick jobs, this variable can be set to a small value to make sure the queue is examined frequently.
For programs with CPU-intensive, long running jobs, this variable can be set to a large value so that not too many processing resources are wasted examining the queue.
- $Forks::Super::Deferred::QUEUE_DEBUG
-
If set to a true value, the
Forks::Super::Deferred
module will publish additional messages to the debugging output handle (see "$DEBUG_FH" in Forks::Super::Debug) about what the module is doing. These messages may or may not be interesting.This variable will be set at run-time if the environment variable
FORKS_SUPER_QUEUE_DEBUG
is set.
AUTHOR
Marty O'Brien, <mob@cpan.org>
LICENSE AND COPYRIGHT
Copyright (c) 2009-2018, Marty O'Brien.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
See http://dev.perl.org/licenses/ for more information.