Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackStacking

Опис

public integer Worker::stack ( Threaded &$work )

Appends the referenced object to the stack of the referenced Worker

Параметри

work

Threaded object to be executed by the referenced Worker

Значення, що повертаються

The new length of the stack

Приклади

Приклад #1 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));
/** ... **/
?>

Наведений вище приклад виведе:

int(1)

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top