Gearman::Driver::Job - Handles the POE magic


Gearman-Driver documentation  | view source Contained in the Gearman-Driver distribution.

Index


NAME

Top

Gearman::Driver::Job - Handles the POE magic

DESCRIPTION

Top

This class is responsible for starting/stopping processes as well as handling all pipes (STDOUT/STDERR/STDIN) of the processes. All events are written to a logfile. Possible events are:

* Starting processes
* STDOUT of processes
* STDERR of processes
* Stopping processes

The current interface may only be interesting for people subclassing Gearman::Driver or for people writing commands/extensions for Gearman::Driver::Console.

ATTRIBUTES

Top

driver

Reference to the Gearman::Driver instance.

name

The job's name.

methods

ArrayRef of Gearman::Driver::Job::Method objects.

max_processes

Maximum number of concurrent processes this job may have.

min_processes

Minimum number of concurrent processes this job may have.

processes

This attribute stores a key/value pair containing: $pid => $job

It provides following methods:

* count_processes()
* delete_process($pid)
* get_process($pid)
* get_processes()
* get_pids()
* set_process($pid = $job)>

gearman

Instance of Gearman::Driver::Adaptor.

session

Instance of POE::Session.

lastrun

Each time this job is called it stores time() in this attribute.

lasterror

Each time this job failed it stores time() in this attribute.

lasterror_msg

Each time this job failed it stores the error message in this attribute.

worker

Reference to the worker object.

METHODS

Top

add_process

Starts/forks/adds another process of this job.

remove_process

Removes/kills one process of this job.

AUTHOR

Top

See Gearman::Driver.

COPYRIGHT AND LICENSE

Top

SEE ALSO

Top

* Gearman::Driver
* Gearman::Driver::Adaptor
* Gearman::Driver::Console
* Gearman::Driver::Console::Basic
* Gearman::Driver::Console::Client
* Gearman::Driver::Job::Method
* Gearman::Driver::Loader
* Gearman::Driver::Observer
* Gearman::Driver::Worker

Gearman-Driver documentation  | view source Contained in the Gearman-Driver distribution.