update : 2015.11.03
php.shukuma.com

검색:
 
 
Stacking

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

예제

Example #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)