NAME

Proc::JobQueue::RemoteDependencyJob - add a remote job to a dependency queue

SYNOPSIS

 use Proc::JobQueue::RemoteDependencyJob;

 $job = Proc::JobQueue::RemoteDependencyJob->create(
	host			=> $remote_host_name,
	%remote_job_args
 );

DESCRIPTION

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 create not new) parameters are passed through to RPC::ToWorker but there are a couple that are handled specially:

dependency_graph

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 $job_queue->add($job).

The dependency graph is a Object::Dependency object.

when_done

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.

local_data

If not set, the following will be provided as the local_data parameter that RPC::ToWorker uses.

dependency_graph

A copy, if known.

master_job

A reference to self.

job_queue

A reference to the job queue.

data

Data to send to remote job.

desc

Description of work.

host

Hostname to run on.

eval

String. Code to run on remote system.

chdir

Directory to change to.

preload

String or ARRAY. Modules to pre-load on the remote system.

prequel

String. File-scope eval code.

prefix

String. Prepend each line of output from the remote system with this string.

all_done

Code. A callback to invoke when the remote slave is completely shut down.

ERRATA

There is also a new constructor with different arguments. It is deprecated but retained for backwards compatbility.

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.