NAME
Gearman::Driver::Job - Handles the POE magic
DESCRIPTION
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
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
add_process
Starts/forks/adds another process of this job.
remove_process
Removes/kills one process of this job.
AUTHOR
See Gearman::Driver.
COPYRIGHT AND LICENSE
See Gearman::Driver.