Gearman

Table of Contents

The GearmanClient class

Introduction

Represents a class for connecting to a Gearman job server and making requests to perform some function on provided data. The function performed must be one registered by a Gearman worker and the data passed is opaque to the job server.

Class synopsis

GearmanClient
class GearmanClient {
/* Methods */
public bool addOptions ( int $options )
public bool addServer ([ string $host = 127.0.0.1 [, int $port = 4730 ]] )
public bool addServers ([ string $servers = 127.0.0.1:4730 ] )
public GearmanTask addTask ( string $function_name , string $workload [, mixed &$context [, string $unique ]] )
public GearmanTask addTaskBackground ( string $function_name , string $workload [, mixed &$context [, string $unique ]] )
public GearmanTask addTaskHigh ( string $function_name , string $workload [, mixed &$context [, string $unique ]] )
public GearmanTask addTaskHighBackground ( string $function_name , string $workload [, mixed &$context [, string $unique ]] )
public GearmanTask addTaskLow ( string $function_name , string $workload [, mixed &$context [, string $unique ]] )
public GearmanTask addTaskLowBackground ( string $function_name , string $workload [, mixed &$context [, string $unique ]] )
public GearmanTask addTaskStatus ( string $job_handle [, string &$context ] )
public bool clearCallbacks ( void )
public GearmanClient clone ( void )
public __construct ( void )
public string context ( void )
public string data ( void )
public string do ( string $function_name , string $workload [, string $unique ] )
public string doBackground ( string $function_name , string $workload [, string $unique ] )
public string doHigh ( string $function_name , string $workload [, string $unique ] )
public string doHighBackground ( string $function_name , string $workload [, string $unique ] )
public string doJobHandle ( void )
public string doLow ( string $function_name , string $workload [, string $unique ] )
public string doLowBackground ( string $function_name , string $workload [, string $unique ] )
public string doNormal ( string $function_name , string $workload [, string $unique ] )
public array doStatus ( void )
public bool echo ( string $workload )
public string error ( void )
public int getErrno ( void )
public array jobStatus ( string $job_handle )
public bool ping ( string $workload )
public bool removeOptions ( int $options )
public int returnCode ( void )
public bool runTasks ( void )
public void setClientCallback ( callable $callback )
public bool setCompleteCallback ( callable $callback )
public bool setContext ( string $context )
public bool setCreatedCallback ( string $callback )
public bool setData ( string $data )
public bool setDataCallback ( callable $callback )
public bool setExceptionCallback ( callable $callback )
public bool setFailCallback ( callable $callback )
public bool setOptions ( int $options )
public bool setStatusCallback ( callable $callback )
public bool setTimeout ( int $timeout )
public bool setWarningCallback ( callable $callback )
public bool setWorkloadCallback ( callable $callback )
public int timeout ( void )
}

The GearmanJob class

Introduction

Class synopsis

GearmanJob
class GearmanJob {
/* Methods */
public bool complete ( string $result )
public __construct ( void )
public bool data ( string $data )
public bool exception ( string $exception )
public bool fail ( void )
public string functionName ( void )
public string handle ( void )
public int returnCode ( void )
public bool sendComplete ( string $result )
public bool sendData ( string $data )
public bool sendException ( string $exception )
public bool sendFail ( void )
public bool sendStatus ( int $numerator , int $denominator )
public bool sendWarning ( string $warning )
public bool setReturn ( int $gearman_return_t )
public bool status ( int $numerator , int $denominator )
public string unique ( void )
public bool warning ( string $warning )
public string workload ( void )
public int workloadSize ( void )
}

The GearmanTask class

Introduction

Class synopsis

GearmanTask
class GearmanTask {
/* Methods */
public __construct ( void )
public GearmanTask create ( void )
public string data ( void )
public int dataSize ( void )
public string function ( void )
public string functionName ( void )
public bool isKnown ( void )
public bool isRunning ( void )
public string jobHandle ( void )
public array recvData ( int $data_len )
public int returnCode ( void )
public int sendData ( string $data )
public int sendWorkload ( string $data )
public int taskDenominator ( void )
public int taskNumerator ( void )
public string unique ( void )
public string uuid ( void )
}

The GearmanWorker class

Introduction

Class synopsis

GearmanWorker
class GearmanWorker {
/* Methods */
public bool addFunction ( string $function_name , callable $function [, mixed &$context [, int $timeout ]] )
public bool addOptions ( int $option )
public bool addServer ([ string $host = 127.0.0.1 [, int $port = 4730 ]] )
public bool addServers ( string $servers = 127.0.0.1:4730 )
public void clone ( void )
public __construct ( void )
public bool echo ( string $workload )
public string error ( void )
public int getErrno ( void )
public int options ( void )
public bool register ( string $function_name [, int $timeout ] )
public bool removeOptions ( int $option )
public int returnCode ( void )
public bool setId ( string $id )
public bool setOptions ( int $option )
public bool setTimeout ( int $timeout )
public int timeout ( void )
public bool unregister ( string $function_name )
public bool unregisterAll ( void )
public bool wait ( void )
public bool work ( void )
}

The GearmanException class

Introduction

Class synopsis

GearmanException
class GearmanException extends Exception {
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Methods */
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Exception Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
}