php[tek] 2018 : Call for Speakers

GearmanClient::setTimeout

(PECL gearman >= 0.6.0)

GearmanClient::setTimeoutEstablece el tiempo máximo de inactividad para actividad de entrada/salida en el socket

Descripción

public bool GearmanClient::setTimeout ( int $timeout )

Establece el tiempo máximo de inactividad para actividad de entrada/salida en el socket

Parámetros

timeout

Un intervalo de tiempo en milisegundos

Valores devueltos

Siempre retorna TRUE.

add a note add a note

User Contributed Notes 2 notes

up
4
Ismael Cristal Jr
5 years ago
GearmanClient has a default timeout of -1 you need to set this to a positive number using setTimeout to avoid cases where your script waits forever to run a job even if there are no workers running at all.
up
0
casper at bcx dot nl
2 months ago
If a timeout is set with this method, and a timeout occurred, calling ->returnCode() will return GEARMAN_TIMEOUT

Beware that a timeout of for example a doBackground() call does not mean the job did not start. It's very possible the job got submitted and started but the gearmand server was not able to communicate that information back to you.
To Top