(PECL pthreads >= 0.36)
Worker::getStacked — Stack Analysis
Returns the number of Stackables waiting to be executed by the referenced Worker
Esta función no tiene parámetros.
An integral value
Ejemplo #1 Returns the number of objects currently waiting to be executed by the referenced Worker
<?php
class Work extends Stackable {
/** ... **/
public function run(){
/** ... **/
}
}
class My extends Worker {
public function run(){
/** ... **/
}
}
$my = new My();
/** ... **/
$my->stack(new Work());
/** ... **/
printf("My worker has %d jobs remaining\n", $my->getStacked());
/** ... **/
?>
El resultado del ejemplo sería:
My worker has 5 jobs remaining