La classe GearmanClient

(PECL gearman >= 0.5.0)

Introduction

Représente une classe pour se connecter à un serveur de tâches Gearman et lui soumettre des requêtes pour appliquer des fonctions sur les données fournies. La fonction appliquée doit faire partie de celles référencées par un agent Gearman et les données traitées restent opaques du point de vue du serveur de tâches.

Synopsis de la classe

class GearmanClient {
/* Méthodes */
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 $function): bool
public setContext(string $data): bool
public setCreatedCallback(callable $function): bool
public setDataCallback(callable $function): bool
public setFailCallback(callable $function): bool
public setOptions(int $option): bool
public setStatusCallback(callable $function): bool
public setTimeout(int $timeout): bool
public setWarningCallback(callable $function): bool
public setWorkloadCallback(callable $function): bool
public timeout(): int
public wait(): bool
}

Sommaire

add a note add a note

User Contributed Notes

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