phpday 2027 - Call for Papers

GearmanClient::setStatusCallback

(PECL gearman >= 0.5.0)

GearmanClient::setStatusCallback — Set a callback for collecting task status

Descrizione

public function GearmanClient::setStatusCallback(callable $callback): bool

Sets a callback function used for getting updated status information from a worker.

Nota:

La callback verrà attivata solo per i task aggiunti (ad es. chiamando GearmanClient::addTask()) dopo la chiamata a questo metodo.

Elenco dei parametri

callback

Una funzione o un metodo da chiamare. Dovrebbe restituire un valore di ritorno Gearman valido.

Se non è presente alcuna istruzione return, il valore predefinito è GEARMAN_SUCCESS.

function callback(GearmanTask $task, mixed $context): int
task

Il task per cui viene chiamata questa callback.

context

Qualsiasi valore sia stato passato a GearmanClient::addTask() (o a un metodo equivalente) come context.

Valori restituiti

Restituisce true in caso di successo o false in caso di fallimento.

Vedere anche:

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top