(PECL gearman >= 0.5.0)
GearmanClient::setWorkloadCallback — Set a callback for accepting incremental data updates
Sets a callback function to be called when a worker needs to send back data prior to job completion. A worker can do this when it needs to send updates, send partial results, or flush data during long running jobs.
Nota:
La callback verrà attivata solo per i task aggiunti (ad es. chiamando GearmanClient::addTask()) dopo la chiamata a questo metodo.
callbackUna 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.
taskIl task per cui viene chiamata questa callback.
context
Qualsiasi valore sia stato passato a GearmanClient::addTask() (o a un metodo equivalente) come context.