NAME

McFeely::Job - Perl extension to ease McFeely job queueing.


SYNOPSIS

  use McFeely::Job;
  $job = McFeely::Job->new;
  $job->add_tasks($task1, $task2, $task3, $task4);
  $job->add_dependencies(
        $task2->requires($task1);
        $task4->requires($task2);
  );
  $job->enqueue or die $job->errstr, "\n";


DESCRIPTION

The Perl extension encapsulates a McFeely job to make queueing easy.


METHODS

new( [TASK, [TASK, ...]] )

Creates a McFeely::Job. Member tasks may be added now. This is equivalent to adding them with the separate add_tasks method.

fnot( ADDRESS )

Sets the failure notification address.

snot( ADDRESS )

Sets the success notification address.

desc( DESCRIPTION )

Sets the description.

add_tasks( TASK, [TASK, ...] )

Adds the listed McFeely::Tasks to the job. If the provided task references are not in the McFeely::Task class or a sub class thereof, die. If you don't want to die in add_tasks, run add_tasks in an eval.

list_tasks

Returns a list of all McFeely::Tasks contained in the job.

add_dependencies( REQUIREMENT, [REQUIREMENT, ...] )

A REQUIREMENT is produced by the requires method of a McFeely::Task or McFeely::Metatask. E.g.

  $job->add_dependencies($task1->requires($task2));

This tells McFeely that $task2 must be completed before $task1 may be attempted.


SEE ALSO

McFeely::Task, McFeely::Metatask


AUTHORS

Matt Liggett <mml@pobox.com>, Chris Dent <cdent@kiva.net>, Adrian Hosey <ahosey@kiva.net>