Worker::getStacked

(PECL pthreads >= 2.0.0)
Stack Analysis
public integer Worker::getStacked ( void )

Returns the number of objects waiting to be executed by the referenced Worker

Returns:

An numeric value

Examples:
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());
/** ... **/
?>

The above example will output:

My worker has 5 jobs remaining
doc_php
2016-02-24 16:05:27
Comments
Leave a Comment

Please login to continue.