NAME

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

SYNOPSIS

 use Proc::JobQueue::RemoteDependencyJob;
 use Object::Dependency;

 $dependency_graph = Object::Dependency->new();

 $job = Proc::JobQueue::RemoteDependencyJob->create(
	dependency_graph	=> $dependency_graph,
	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 is controlled by Proc::JobQueue::DependencyQueue.

It is just like using a RPC::ToWorker, except that the 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:

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:

dependency_graph

A reference to the dependency graph the job queue is using.

master_job

A reference to self.

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.

prequel

String. File-scope eval code.

prefix

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

all_done

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

ERRATA

There is also a new constructor with different arguments. It is 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.