class GearmanJob (View source)

Class: GearmanJob

Methods

int
returnCode()

Returns the last return code issued by the job server.

bool
setReturn(int $gearman_return_t)

Sets the return value for this job, indicates how the job completed.

bool
sendData(string $data)

Sends data to the job server (and any listening clients) for this job.

bool
sendWarning(string $warning)

Sends a warning for this job while it is running.

bool
sendStatus(int $numerator, int $denominator)

Sends status information to the job server and any listening clients. Use this to specify what percentage of the job has been completed.

bool
sendComplete(string $result)

Sends result data and the complete status update for this job.

bool
sendException(string $exception)

Sends the supplied exception when this job is running.

bool
sendFail()

Sends failure status for this job, indicating that the job failed in a known way (as opposed to failing due to a thrown exception).

string
handle()

Returns the opaque job handle assigned by the job server.

string
functionName()

Returns the function name for this job. This is the function the work will execute to perform the job.

string
unique()

Returns the unique identifiter for this job. The identifier is assigned by the client.

string
workload()

Returns the workload for the job. This is serialized data that is to be processed by the worker.

int
workloadSize()

Returns the size of the job's work load (the data the worker is to process) in bytes.

Details

int returnCode()

Returns the last return code issued by the job server.

Return Value

int

A valid Gearman return code

bool setReturn(int $gearman_return_t)

Sets the return value for this job, indicates how the job completed.

Parameters

int $gearman_return_t

A valid Gearman return value

Return Value

bool Description

bool sendData(string $data)

Sends data to the job server (and any listening clients) for this job.

Parameters

string $data

Arbitrary serialized data

Return Value

bool

bool sendWarning(string $warning)

Sends a warning for this job while it is running.

Parameters

string $warning

A warning messages

Return Value

bool

bool sendStatus(int $numerator, int $denominator)

Sends status information to the job server and any listening clients. Use this to specify what percentage of the job has been completed.

Parameters

int $numerator

The numerator of the percentage completed expressed as a fraction

int $denominator

The denominator of the percentage completed expressed as a fraction

Return Value

bool

bool sendComplete(string $result)

Sends result data and the complete status update for this job.

Parameters

string $result

Serialized result data

Return Value

bool

bool sendException(string $exception)

Sends the supplied exception when this job is running.

Parameters

string $exception

An exception description

Return Value

bool

bool sendFail()

Sends failure status for this job, indicating that the job failed in a known way (as opposed to failing due to a thrown exception).

Return Value

bool

string handle()

Returns the opaque job handle assigned by the job server.

Return Value

string

An opaque job handle

string functionName()

Returns the function name for this job. This is the function the work will execute to perform the job.

Return Value

string

The name of a function

string unique()

Returns the unique identifiter for this job. The identifier is assigned by the client.

Return Value

string

An opaque unique identifier

string workload()

Returns the workload for the job. This is serialized data that is to be processed by the worker.

Return Value

string

Serialized data

int workloadSize()

Returns the size of the job's work load (the data the worker is to process) in bytes.

Return Value

int

The size in bytes