略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: GearmanClient

2024-03-28

The GearmanClient class

(PECL gearman >= 0.5.0)

简介

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

目录

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/class.gearmanclient.php

冷却塔厂家 广告
-- 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3