Why not adopt me?
NAME
Proc::JobQueue::DependencyQueue - [DEPRECATED] JobQueue combined with a dependency graph
SYNOPSIS
use Proc::JobQueue::DependencyQueue;
use Object::Dependency;
use Proc::JobQueue::DependencyTask;
use Proc::JobQueue::DependencyJob;
my $dependency_graph = Object::Dependency->new();
my $job = Proc::JobQueue::DependencyJob->new($dependency_graph, $callback_func);
my $task => Proc::JobQueue::DependencyTask->new(desc => $desc, func => $callback_func);
$dependency_graph->add($job);
$dependency_graph->add($task);
my $queue = Proc::JobQueue::DependencyQueue->new(
dependency_graph => $dependency_graph,
hold_all => 1,
);
$job_queue->hold(0);
$queue->startmore();
IO::Event::loop();
IO::Event::unloop_all() if $queue->alldone;
DESCRIPTION
This module is now deprecated in favor of Proc::JobQueue::EventQueue.
This module is a sublcass of Proc::JobQueue. It combines a job queue with a a dependency graph, Object::Dependency.
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.
It's expected that you'll use asynchronous I/O via IO::Event, but that is not required. If you're using IO::Event, it sets up a timer event to start more jobs. It also changes $Event::DIED
to unloop.
API
In addition to the parameters supported by Proc::JobQueue, the following construction parameters are used:
- dependency_graph
-
This should be a Object::Dependency object.
In addition to the methods inherited from Proc::JobQueue, this module adds:
LICENSE
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.