downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Worker::start> <Worker::shutdown
[edit] Last updated: Fri, 17 May 2013

view this page in

Worker::stack

(PECL pthreads >= 0.36)

Worker::stackStacking

Beschreibung

final public int Worker::stack ( Stackable $work )

Appends the referenced Stackable to the stack of the referenced Worker

Parameter-Liste

work

An object of type Stackable to be executed by the referenced Worker

Rückgabewerte

The new length of the stack

Beispiele

Beispiel #1 Passing Stackables to Workers for execution in the Worker Thread

<?php
class Work extends Stackable {
    
/** ... **/

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

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

int(1)



add a note add a note User Contributed Notes Worker::stack - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites