• PHP Video Tutorials

PHP - Worker::getStacked() Function



Worker::getStacked() function can get the remaining stack size.

Syntax

public int Worker::getStacked( void )

Worker::getStacked() function can return the number of tasks left on stack.

Worker::getStacked() function doesn't have any parameters and can return an integer value.

Example

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());
php_function_reference.htm
Advertisements