Gearman

目次

The GearmanClient class

はじめに

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.

クラス概要

GearmanClient
/* メソッド */
public __construct()
public bool addOptions(int $option)
public bool addServer(string $host = null, int $port = 0, bool $setupExceptionHandler = true)
public bool addServers(string $servers = null, bool $setupExceptionHandler = true)
public GearmanTaskfalse addTask(
    string $function_name,
    stringintfloat $workload,
    mixed $context = null,
    stringnull $unique_key = null
)
public GearmanTaskfalse addTaskBackground(
    string $function_name,
    stringintfloat $workload,
    mixed $context = null,
    stringnull $unique_key = null
)
public GearmanTaskfalse addTaskHigh(
    string $function_name,
    stringintfloat $workload,
    mixed $context = null,
    stringnull $unique_key = null
)
public GearmanTaskfalse addTaskHighBackground(
    string $function_name,
    stringintfloat $workload,
    mixed $context = null,
    stringnull $unique_key = null
)
public GearmanTaskfalse addTaskLow(
    string $function_name,
    stringintfloat $workload,
    mixed $context = null,
    stringnull $unique_key = null
)
public GearmanTaskfalse addTaskLowBackground(
    string $function_name,
    stringintfloat $workload,
    mixed $context = null,
    stringnull $unique_key = null
)
public GearmanTaskfalse addTaskStatus(string $job_handle, mixed $context = null)
public bool clearCallbacks()
public string context()
public string doBackground(string $function, string $workload, stringnull $unique = null)
public string doHigh(string $function, string $workload, stringnull $unique = null)
public string doHighBackground(string $function, string $workload, stringnull $unique = null)
public string doJobHandle()
public string doLow(string $function, string $workload, stringnull $unique = null)
public string doLowBackground(string $function, string $workload, stringnull $unique = null)
public string doNormal(string $function, string $workload, stringnull $unique = null)
public array doStatus()
public stringfalse error()
public int getErrno()
public array jobStatus(string $job_handle)
public bool ping(string $workload)
public bool removeOptions(int $option)
public int returnCode()
public bool runTasks()
public bool setCompleteCallback(callable $function)
public bool setContext(string $data)
public bool setCreatedCallback(callable $function)
public bool setDataCallback(callable $function)
public bool setExceptionCallback(callable $function)
public bool setFailCallback(callable $function)
public bool setOptions(int $option)
public bool setStatusCallback(callable $function)
public bool setTimeout(int $timeout)
public bool setWarningCallback(callable $function)
public bool setWorkloadCallback(callable $function)
public int timeout()
public bool wait()

The GearmanJob class

はじめに

クラス概要

GearmanJob
/* メソッド */
public falsestring functionName()
public falsestring handle()
public int returnCode()
public bool sendComplete(string $result)
public bool sendData(string $data)
public bool sendException(string $exception)
public bool sendFail()
public bool sendStatus(int $numerator, int $denominator)
public bool sendWarning(string $warning)
public bool setReturn(int $gearman_return_t)
public falsestring unique()
public string workload()
public int workloadSize()

The GearmanTask class

はじめに

クラス概要

GearmanTask
/* メソッド */
public __construct()
public falsestring data()
public intfalse dataSize()
public falsestring functionName()
public bool isKnown()
public bool isRunning()
public falsestring jobHandle()
public falsearray recvData(int $data_len)
public int returnCode()
public intfalse sendWorkload(string $data)
public falseint taskDenominator()
public falseint taskNumerator()
public falsestring unique()

The GearmanWorker class

はじめに

クラス概要

GearmanWorker
/* メソッド */
public __construct()
public bool addFunction(
    string $function_name,
    callable $function,
    mixed $context = null,
    int $timeout = 0
)
public true addOptions(int $option)
public bool addServer(string $host = null, int $port = 0, bool $setupExceptionHandler = true)
public bool addServers(string $servers = null, bool $setupExceptionHandler = true)
public stringfalse error()
public int getErrno()
public int options()
public bool register(string $function_name, int $timeout = 0)
public true removeOptions(int $option)
public int returnCode()
public bool setId(string $id)
public true setOptions(int $option)
public true setTimeout(int $timeout)
public int timeout()
public bool unregister(string $function_name)
public bool unregisterAll()
public bool wait()
public bool work()

The GearmanException class

はじめに

クラス概要

GearmanException
/* 継承したプロパティ */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* メソッド */
/* 継承したメソッド */
final public string Exception::getMessage()
final public Throwablenull Exception::getPrevious()
final public int Exception::getCode()
final public string Exception::getFile()
final public int Exception::getLine()
final public array Exception::getTrace()
final public string Exception::getTraceAsString()
public string Exception::__toString()
private void Exception::__clone()