class GearmanTask (View source)

Class: GearmanTask

Methods

int
returnCode()

Returns the last Gearman return code for this task.

string
functionName()

Returns the name of the function this task is associated with, i.e., the function the Gearman worker calls.

string|false
unique()

Returns the unique identifier for this task. This is assigned by the GearmanClient, as opposed to the job handle which is set by the Gearman job server.

string
jobHandle()

Returns the job handle for this task.

bool
isKnown()

Gets the status information for whether or not this task is known to the job server.

bool
isRunning()

Indicates whether or not this task is currently running.

int|false
taskNumerator()

Returns the numerator of the percentage of the task that is complete expressed as a fraction.

int|false
taskDenominator()

Returns the denominator of the percentage of the task that is complete expressed as a fraction.

int|false
sendWorkload(string $data)

No description

string|false
data()

Returns data being returned for a task by a worker.

int|false
dataSize()

Returns the size of the data being returned for a task.

array|false
recvData(int $data_len)

No description

Details

int returnCode()

Returns the last Gearman return code for this task.

Return Value

int

A valid Gearman return code

string functionName()

Returns the name of the function this task is associated with, i.e., the function the Gearman worker calls.

Return Value

string

A function name

string|false unique()

Returns the unique identifier for this task. This is assigned by the GearmanClient, as opposed to the job handle which is set by the Gearman job server.

Return Value

string|false

The unique identifier, or false if no identifier is assigned

string jobHandle()

Returns the job handle for this task.

Return Value

string

The opaque job handle

bool isKnown()

Gets the status information for whether or not this task is known to the job server.

Return Value

bool

true if the task is known, false otherwise

bool isRunning()

Indicates whether or not this task is currently running.

Return Value

bool

true if the task is running, false otherwise

int|false taskNumerator()

Returns the numerator of the percentage of the task that is complete expressed as a fraction.

Return Value

int|false

A number between 0 and 100, or false if cannot be determined

int|false taskDenominator()

Returns the denominator of the percentage of the task that is complete expressed as a fraction.

Return Value

int|false

A number between 0 and 100, or false if cannot be determined

int|false sendWorkload(string $data)

.

Parameters

string $data

Data to send to the worker

Return Value

int|false

The length of data sent, or false if the send failed

string|false data()

Returns data being returned for a task by a worker.

Return Value

string|false

The serialized data, or false if no data is present

int|false dataSize()

Returns the size of the data being returned for a task.

Return Value

int|false

The data size, or false if there is no data

array|false recvData(int $data_len)

.

Parameters

int $data_len

Length of data to be read

Return Value

array|false

An array whose first element is the length of data read and the second is the data buffer. Returns false if the read failed