Gearman::Driver::Job - Handles the POE magic
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.
Reference to the Gearman::Driver instance.
The job's name.
Code reference which is run called by Gearman::XS::Worker. Actually it's not called directly by it, but in a wrapped coderef.
Reference to the worker object.
Maximum number of concurrent processes this job may have.
Minimum number of concurrent processes this job may have.
This may be set to a method name which is implemented in the worker class or any subclass. If the method is not available, it will fail. The returned value of the job method is passed to this method and the return value of this method is sent back to the Gearman server.
See also: "Encode" in Gearman::Driver::Worker.
This may be set to a method name which is implemented in the worker class or any subclass. If the method is not available, it will fail. The workload from Gearman::XS::Job is passed to this method and the return value is passed as argument $workload to the job method.
$workload
See also: "Decode" in Gearman::Driver::Worker.
This attribute stores a key/value pair containing: $pid => $job
$pid
It provides following methods:
count_processes()
delete_process($pid)
get_process($pid)
get_processes()
get_pids()
set_process($pid = $job)>
set_process($pid =
Instance of Gearman::Driver::Adaptor.
Instance of POE::Session.
Each time this job is called it stores time() in this attribute.
time()
This depends on "extended_status" in Gearman::Driver.
Each time this job failed it stores time() in this attribute.
Each time this job failed it stores the error message in this attribute.
Starts/forks/adds another process of this job.
Removes/kills one process of this job.
See Gearman::Driver.
Gearman::Driver
Gearman::Driver::Adaptor
Gearman::Driver::Console
Gearman::Driver::Console::Basic
Gearman::Driver::Console::Client
Gearman::Driver::Loader
Gearman::Driver::Observer
Gearman::Driver::Worker
To install Gearman::Driver, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gearman::Driver
CPAN shell
perl -MCPAN -e shell install Gearman::Driver
For more information on module installation, please visit the detailed CPAN module installation guide.