Aijaz Ansari > TaskForest-1.09 > TaskForest::Job

Download:
TaskForest/TaskForest-1.09.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 1.09   Source   Latest Release: TaskForest-1.33

NAME ^

TaskForest::Job - A representation of a program that can be run by the operating system

SYNOPSIS ^

 use TaskForest::Job;

 $job = TaskForest::Job->new(name => $job_name);
 # now $job->{status} eq 'Waiting'
 # and $job->check() == 0

DOCUMENTATION ^

If you're just looking to use the taskforest application, the only documentation you need to read is that for TaskForest. You can do this either of the two ways:

perldoc TaskForest

OR

man TaskForest

If you're a developer and you want to understand the code, I would recommend that you read the pods in this order:

Finally, read the documentation in the source. Great efforts have been made to keep it current and relevant.

DESCRIPTION ^

A job is a program that can be run. It is represented as a file in the files system whose name is the same as the job name. Most of the manipulation of the attributes of jobs is done by objects of type TaskForest::Family.

A job name may only contain the characters a-z, A-Z, 0-9, and '_'.

When a job is run by the run wrapper (bin/run), two status files are created in the log directory. The first is created when a job starts and has a name of $FamilyName.$JobName.pid. This file contains some attributes of the job. When the job completes, more attributes are written to this file. See the list of attributes below.

When the job completes, another file is written to the log directory. The name of this file will be $FamilyName.$JobName.0 if the job ran successfully, and $FamilyName.$JobName.1 if the job failed. In either case, the file will contain the exit code of the job (0 in the case of success and non-zero otherwise).

The system tracks the following properties of a job:

METHODS ^

new()
 Usage     : my $job = TaskForest::Job->new();
 Purpose   : The Job constructor creates a simple job data
             structure.  Other classes will set and examine status
             and return code. 
 Returns   : Self
 Argument  : None
 Throws    : "No job name specified" if the required parameter "name"
             is not provided. 
check()
 Usage     : $job->check();
 Purpose   : Checks to see whether the job succeeded.  Implies that
             it has already run.
 Returns   : 1 if it succeeded.  0 otherwise.
 Argument  : None
 Throws    : Nothing