The GearmanClient class

(PECL gearman >= 0.5.0)

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

class GearmanClient {
/* Methods */
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(string $function, string $workload, ?string $unique = null): string
public doNormal(string $function, string $workload, ?string $unique = null): string
public doStatus(): array
public error(): string|false
public getErrno(): int
public jobStatus(string $job_handle): array
public ping(string $workload): bool
public removeOptions(int $option): bool
public returnCode(): int
public runTasks(): bool
public setCompleteCallback(callable $callback): bool
public setContext(string $data): bool
public setCreatedCallback(callable $callback): bool
public setDataCallback(callable $callback): bool
public setFailCallback(callable $callback): bool
public setOptions(int $option): 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
}

Table of Contents

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top