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, 24 May 2013

view this page in

Worker::stack

(PECL pthreads >= 0.36)

Worker::stackFile d'attente

Description

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

Ajoute le Stackable référencé à la file d'attente du Worker référencé.

Liste de paramètres

work

Un objet de type Stackable à exécuter par le Worker référencé.

Valeurs de retour

La nouvelle taille de la file.

Exemples

Exemple #1 Passe les Stackables aux Workers pour exécution dans le Thread Worker

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

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

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

L'exemple ci-dessus va afficher :

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 | sitemap | contact | advertising | mirror sites