Worker::unstack

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

Removes the referenced object ( or all objects if parameters are void ) from stack of the referenced Worker

Parameters:
work

Threaded object previously stacked onto Worker

Returns:

The new length of the stack

Examples:
Removing objects from the stack of Workers
1
2
3
4
5
6
7
8
9
10
11
12
<?php
class Work extends Threaded {
    public function run() {
         
    }
}
 
$my new Worker();
$work new Work();
var_dump($my->stack($work));
var_dump($my->unstack($work));
?>

The above example will output:

int(1)
int(0)
doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.