Proc::JobQueue::EventQueue - JobQueue combined with IO::Event
use Proc::JobQueue::EventQueue; use Proc::JobQueue::DependencyTask; use Proc::JobQueue::DependencyJob; my $queue = Proc::JobQueue::EventQueue->new( hold_all => 1, ); my $job = Proc::JobQueue::DependencyJob->new($queue, $callback_func); my $task => Proc::JobQueue::DependencyTask->new(desc => $desc, func => $callback_func); $dependency_graph->add($job); $dependency_graph->add($task); $job_queue->hold(0); $queue->startmore(); IO::Event::loop(); IO::Event::unloop_all() if $queue->alldone;
This module is a sublcass of Proc::JobQueue. It combines the job queue with IO::Event for an asynchronous event loop. IO::Event can use a select loop from Event, AnyEvent or its own.
The jobs that it runs are either full-fledged jobs, Proc::JobQueue::DependencyJob, or simple synchronous one-shot perl callbacks that execute as soon as their prerequisites are met: Proc::JobQueue::DependencyTask.
Generally, the way to use this is to generate your dependency graph, then create your job queue, then start some jobs.
In addition to the parameters supported by Proc::JobQueue, the following construction parameters are used:
Code REF. If provided, invoke it to when the job queue is empty instead of calling IO::Event::unloop_all().
IO::Event::unloop_all()
Code REF. If provided, override the default behavior of how to handle the failure of a job. See the code for details.
Copyright (C) 2007-2008 SearchMe, Inc. Copyright (C) 2008-2010 David Sharnoff. Copyright (C) 2011 Google, Inc. This package may be used and redistributed under the terms of either the Artistic 2.0 or LGPL 2.1 license.
To install Proc::JobQueue, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Proc::JobQueue
CPAN shell
perl -MCPAN -e shell install Proc::JobQueue
For more information on module installation, please visit the detailed CPAN module installation guide.