Worker
PHP Manual

Worker::getStacked

(PECL pthreads >= 2.0.0)

Worker::getStackedStack Analysis

Açıklama

public integer Worker::getStacked ( void )

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

Değiştirgeler

Bu işlevin değiştirgesi yoktur.

Dönen Değerler

An numeric value

Örnekler

Örnek 1 Returns the number of objects currently waiting to be executed by the referenced Worker

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

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

Yukarıdaki örneğin çıktısı:

My worker has 5 jobs remaining


Worker
PHP Manual