Proc::JobQueue::RemoteDependencyJob - add a remote job to a dependency queue
use Proc::JobQueue::RemoteDependencyJob; $job = Proc::JobQueue::RemoteDependencyJob->create( host => $remote_host_name, %remote_job_args );
This is sublcass of Proc::JobQueue::Job. It combines a RPC::ToWorker with a Proc::JobQueue and provides a way to run arbitrary perl code in dependency order on a network of systems. Overall execution must be controlled by Proc::JobQueue::EventQueue. These jobs will not work with Proc::JobQueue::BackgroundQueue.
It is just like using a RPC::ToWorker, except that the remote job doesn't run right away: it starts up when the job queue is ready to run it.
Most construction (note: use
new) parameters are passed through to RPC::ToWorker but there are a couple that are handled specially:
A reference to the dependency graph the job queue is using. This is optional. If presentt the job will be inserted into the dependency graph with no dependencies. If it is not present, the job will need to be added some other way: if it has dependencies, then with
$dependency_graph->add($job) or if it does not have dependencies then with
The dependency graph is a Object::Dependency object.
A callback to invoke when the remote job has finished. The return values from the remotely eval'ed code will be passed to the callback. If provided, the callback must call
$job->finished(0) or otherwise mark itself as finished (see Proc::JobQueue::DependencyJob). If no callback is provided then
$job->finished(0) will be called.
If not set, the following will be provided as the
local_data parameter that RPC::ToWorker uses.
Data to send to remote job.
Description of work.
Hostname to run on.
String. Code to run on remote system.
Directory to change to.
String or ARRAY. Modules to pre-load on the remote system.
String. File-scope eval code.
String. Prepend each line of output from the remote system with this string.
Code. A callback to invoke when the remote slave is completely shut down.
There is also a
new constructor with different arguments. It is deprecated but retained for backwards compatbility.
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.