Worker
PHP 手册

Worker::unstack

(PECL pthreads >= 0.36)

Worker::unstackStacking

说明

final public int Worker::unstack ([ Stackable $work ] )

Removes the referenced Stackable ( or all Stackables if parameters are void ) from stack of the referenced Worker

参数

work

An object of type Stackable

返回值

The new length of the stack

范例

Example #1 Removing Stackables from Workers

<?php
class Work extends Stackable {
    public function 
run() {
        
    }
}

class 
My extends Worker {
    public function 
run() {
        
/** ... **/
    
}
}
$my = new My();
$work = new Work();
var_dump($my->stack($work));
var_dump($my->unstack($work));
?>

以上例程会输出:

int(1)
int(0)


Worker
PHP 手册