update : 2015.11.03
php.shukuma.com

검색:
 
 
Stack Analysis

Worker::getStacked

(PECL pthreads >= 2.0.0)

Worker::getStackedStack Analysis

설명

public integer Worker::getStacked ( void )

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

인수

이 함수는 인수가 없습니다.

반환값

An numeric value

예제

Example #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());
/** ... **/
?>

위 예제의 출력:

My worker has 5 jobs remaining