1.4. gearman.job
— Gearman job definitions¶
1.4.1. GearmanJob - Basic information about a requested job¶
1.4.2. GearmanJobRequest - State tracker for requested jobs¶
-
class
gearman.job.
GearmanJobRequest
(gearman_job, initial_priority=None, background=False, max_attempts=1)[source]¶ Represents a job request... used in GearmanClient to represent job states
1.4.2.1. Tracking job submission¶
-
GearmanJobRequest.
gearman_job
¶ GearmanJob
- Job that is being tracked by thisGearmanJobRequest
object
-
GearmanJobRequest.
priority
¶
PRIORITY_NONE
[default]PRIORITY_LOW
PRIORITY_HIGH
-
GearmanJobRequest.
background
¶ boolean
- Is this job backgrounded?
-
GearmanJobRequest.
connection_attempts
¶ integer
- Number of attempted connection attempts
-
GearmanJobRequest.
max_connection_attempts
¶ integer
- Maximum number of attempted connection attempts before raising an exception
1.4.2.2. Tracking job progress¶
-
GearmanJobRequest.
result
¶ binary
- Job’s returned binary payload - Populated if and only if JOB_COMPLETE
-
GearmanJobRequest.
exception
¶ binary
- Job’s exception binary payload
-
GearmanJobRequest.
state
¶
JOB_UNKNOWN
- Request state is currently unknown, either unsubmitted or connection failedJOB_PENDING
- Request has been submitted, pending handleJOB_CREATED
- Request has been acceptedJOB_FAILED
- Request received an explicit job failure (job done but errored out)JOB_COMPLETE
- Request received an explicit job completion (job done with results)
-
GearmanJobRequest.
timed_out
¶ boolean
- Did the client hit its polling_timeout prior to a job finishing?
-
GearmanJobRequest.
complete
¶ boolean
- Does the client need to continue to poll for more updates from this job?
1.4.2.3. Tracking in-flight job updates¶
Certain GearmanJob’s may send back data prior to actually completing. GearmanClient
uses these queues to keep track of what/when we received certain updates.
-
GearmanJobRequest.
warning_updates
¶ collections.deque
- Job’s warning binary payloads
-
GearmanJobRequest.
data_updates
¶ collections.deque
- Job’s data binary payloads
-
GearmanJobRequest.
status
¶ dictionary
- Job’s status- handle -
string
- Job handle - known -
boolean
- Is the server aware of this request? - running -
boolean
- Is the request currently being processed by a worker? - numerator -
integer
- denominator -
integer
- time_received -
integer
- Time last updated
- handle -
New in version 2.0.1: Replaces GearmanJobRequest.status_updates and GearmanJobRquest.server_status
-
GearmanJobRequest.
status_updates
¶
Deprecated since version 2.0.1: Replaced by GearmanJobRequest.status
-
GearmanJobRequest.
server_status
¶
Deprecated since version 2.0.1: Replaced by GearmanJobRequest.status