Worker::stack

(PECL pthreads >= 2.0.0)
Stacking
public integer Worker::stack ( Threaded &$work )

Appends the referenced object to the stack of the referenced Worker

Parameters:
work

Threaded object to be executed by the referenced Worker

Returns:

The new length of the stack

Examples:
Stacking objects for execution in Workers
<?php
class Work extends Threaded {
    /** ... **/

    public function run(){
        /** ... **/
    }
}

$my = new Worker();
$work = new Work();
/** ... **/
var_dump($my->stack($work));
/** ... **/
?>

The above example will output:

int(1)
doc_php
2016-02-24 16:05:28
Comments
Leave a Comment

Please login to continue.