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: Fri, 17 May 2013

view this page in

Worker::getStacked

(PECL pthreads >= 0.36)

Worker::getStackedStack Analysis

Beschreibung

final public int Worker::getStacked ( void )

Returns the number of Stackables waiting to be executed by the referenced Worker

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

An integral value

Beispiele

Beispiel #1 Returns the number of objects currently waiting to be executed by the referenced Worker

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

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

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

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

My worker has 5 jobs remaining



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