Worker::getStacked
(PECL pthreads >= 0.36)
Worker::getStacked — Stack Analysis
Descrierea
final public int Worker::getStacked
( void
)
Returns the number of Stackables waiting to be executed by the referenced Worker
Parametri
Această funcție nu are parametri.
Valorile întoarse
An integral value
Exemple
Example #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());
/** ... **/
?>
Exemplul de mai sus va afișa:
My worker has 5 jobs remaining
There are no user contributed notes for this page.
