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

search for in the

Worker::getThreadId> <Worker::getCreatorId
[edit] Last updated: Mon, 20 May 2013

view this page in

Worker::getStacked

(PECL pthreads >= 0.36)

Worker::getStackedAnalyse de pile

Description

final public int Worker::getStacked ( void )

Retourne le nombre de stackables attendant l'exécution par le Worker référencé.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Une valeur entière.

Exemples

Exemple #1 Retourne le nombre d'objets actuellement en attente d'exécution par le Worker référencé

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

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

class 
My extends Worker {
    public function 
run(){
        
/** ... **/
    
}
}
$my = new My();
/** ... **/
$my->stack(new Work());
/** ... **/
printf("Mon worker a %d travaux en attente\n"$my->getStacked());
/** ... **/
?>

L'exemple ci-dessus va afficher :

Mon worker a 5 travaux en attente



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

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