03 Jul 2014 18:28:47 UTC
- Distribution: Protocol-Gearman
- Module version: 0.04
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (361 / 3 / 10)
- KwaliteeBus factor: 1
- 89.25% Coverage
- License: perl_5
- Perl: v5.10.0
- Download (32.25KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE user
- JOB OBJECTS
Protocol::Gearman::Worker- implement a Gearman worker
A base class that implements a complete Gearman worker. This abstract class still requires the implementation methods as documented in Protocol::Gearman, but otherwise provides a full set of behaviour useful to Gearman workers.
As it is based on Future it is suitable for both synchronous and asynchronous use. When backed by an implementation capable of performing asynchronously, this object fully supports asynchronous Gearman communication. When backed by a synchronous implementation, it will still yield
Futureinstances but the limitations of the synchronous implementation may limit how much concurrency and asynchronous behaviour can be acheived.
A simple concrete implementation suitable for synchronous use can be found in Net::Gearman::Worker.
Informs the server that the worker can perform a function of the given name.
The following named options are recognised:
- timeout => INT
If specified, the function is registered using the
CAN_DO_TIMEOUTvariant, which sets a timeout on the Gearman server after which the function ought to have completed. The timeout is specified in seconds.
Returns a future that will eventually yield another job assignment from the server as an instance of a job object; see below.
Invoked by the
failmethods on a job object, after the server has been informed of the final status of the job. By default this method does nothing, but it is provided for subclasses to override, to be informed when a job is finished.
Objects of this type are returned by the
grab_jobmethod. They represent individual job assignments from the server, and can be used to obtain details of the work to perform, and report on its result.
Protocol::Gearman::Workerobject the job was received by.
Returns the job handle assigned by the server. Most implementations should not need to use this directly.
The function name and opaque argument data bytes sent by the requesting client.
Sends more data back to the client. Intended for long-running jobs with incremental output.
Sends a warning to the client.
Sets the current progress of the job.
Informs the server that the job is now complete, and sets its result.
Informs the server that the job has failed.
Optionally an exception value can be supplied; if given this will be sent to the server using a
WORK_EXCEPTIONmessage. Note that not all clients will receive this; it is an optional feature.
Paul Evans <email@example.com>
Module Install Instructions
To install Protocol::Gearman, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Protocol::Gearman
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|