(PECL pthreads >= 2.0.0)
Worker::getStacked — Stack Analysis
Returns the number of objects waiting to be executed by the referenced Worker
Diese Funktion hat keine Parameter.
An numeric value
Beispiel #1 Returns the number of objects currently waiting to be executed by the referenced Worker
<?php
class Work extends Threaded {
/** ... **/
public function run(){
/** ... **/
}
}
$my = new Worker();
/** ... **/
$work = new Work();
$my->stack($work);
/** ... **/
printf("My worker has %d jobs remaining\n", $my->getStacked());
/** ... **/
?>
Das oben gezeigte Beispiel erzeugt folgende Ausgabe:
My worker has 5 jobs remaining