PHP Conference Japan 2024

GearmanClient 类

(PECL gearman >= 0.5.0)

简介

表示一个用于连接到 Gearman 作业服务器并在提供的数据上执行某些功能发出请求的类。执行的功能必须是 Gearman 工作器注册的功能,并且传递的数据对作业服务器是不透明的。

类概要

class GearmanClient {
/* 方法 */
public __construct()
public addOptions(int $option): bool
public addServer(string $host = null, int $port = 0, bool $setupExceptionHandler = true): bool
public addServers(string $servers = null, bool $setupExceptionHandler = true): bool
public addTask(
    string $function_name,
    string|int|float $workload,
    mixed $context = null,
    ?string $unique_key = null
): GearmanTask|false
public addTaskBackground(
    string $function_name,
    string|int|float $workload,
    mixed $context = null,
    ?string $unique_key = null
): GearmanTask|false
public addTaskHigh(
    string $function_name,
    string|int|float $workload,
    mixed $context = null,
    ?string $unique_key = null
): GearmanTask|false
public addTaskHighBackground(
    string $function_name,
    string|int|float $workload,
    mixed $context = null,
    ?string $unique_key = null
): GearmanTask|false
public addTaskLow(
    string $function_name,
    string|int|float $workload,
    mixed $context = null,
    ?string $unique_key = null
): GearmanTask|false
public addTaskLowBackground(
    string $function_name,
    string|int|float $workload,
    mixed $context = null,
    ?string $unique_key = null
): GearmanTask|false
public addTaskStatus(string $job_handle, mixed $context = null): GearmanTask|false
public context(): string
public doBackground(string $function, string $workload, ?string $unique = null): string
public doHigh(string $function, string $workload, ?string $unique = null): string
public doHighBackground(string $function, string $workload, ?string $unique = null): string
public doLow(string $function, string $workload, ?string $unique = null): string
public doLowBackground(字符串 $function, 字符串 $workload, ?字符串 $unique = null): 字符串
public doNormal(字符串 $function, 字符串 $workload, ?字符串 $unique = null): 字符串
public doStatus(): 数组
public getErrno(): 整数
public jobStatus(字符串 $job_handle): 数组
public ping(字符串 $workload): 布尔值
public removeOptions(整数 $option): 布尔值
public returnCode(): 整数
public setOptions(整数 $option): 布尔值
public setTimeout(整数 $timeout): 布尔值
public timeout(): 整数
public wait(): 布尔值
}

目录

添加注释

用户贡献的注释

此页面没有用户贡献的注释。
To Top