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

classGearmanClient {
public__construct()
publicaddOptions(int$option): bool
publicaddServer(string$host = null, int$port = 0, bool$setupExceptionHandler = true): bool
publicaddServers(string$servers = null, bool$setupExceptionHandler = true): bool
publicaddTask(
    string$function_name,
    string|int|float$workload,
    mixed$context = null,
    ?string$unique_key = null
): GearmanTask|false
publicaddTaskBackground(
    string$function_name,
    string|int|float$workload,
    mixed$context = null,
    ?string$unique_key = null
): GearmanTask|false
publicaddTaskHigh(
    string$function_name,
    string|int|float$workload,
    mixed$context = null,
    ?string$unique_key = null
): GearmanTask|false
publicaddTaskHighBackground(
    string$function_name,
    string|int|float$workload,
    mixed$context = null,
    ?string$unique_key = null
): GearmanTask|false
publicaddTaskLow(
    string$function_name,
    string|int|float$workload,
    mixed$context = null,
    ?string$unique_key = null
): GearmanTask|false
publicaddTaskLowBackground(
    string$function_name,
    string|int|float$workload,
    mixed$context = null,
    ?string$unique_key = null
): GearmanTask|false
publicaddTaskStatus(string$job_handle, mixed$context = null): GearmanTask|false
publiccontext(): string
publicdoBackground(string$function, string$workload, ?string$unique = null): string
publicdoHigh(string$function, string$workload, ?string$unique = null): string
publicdoHighBackground(string$function, string$workload, ?string$unique = null): string
publicdoLow(string$function, string$workload, ?string$unique = null): string
publicdoLowBackground(string$function, string$workload, ?string$unique = null): string
publicdoNormal(string$function, string$workload, ?string$unique = null): string
publicdoStatus(): array
publicerror(): string|false
publicgetErrno(): int
publicjobStatus(string$job_handle): array
publicping(string$workload): bool
publicremoveOptions(int$option): bool
publicreturnCode(): int
publicrunTasks(): bool
publicsetContext(string$data): bool
publicsetDataCallback(callable$function): bool
publicsetFailCallback(callable$function): bool
publicsetOptions(int$option): bool
publicsetTimeout(int$timeout): bool
publictimeout(): int
publicwait(): bool
}

Table of Contents

To Top