pht\Thread::taskCount
(PECL pht >= 0.0.1)
pht\Thread::taskCount — Gets a thread's task count
参数
此函数没有参数。
返回值
The number of tasks remaining to be processed.
范例
Example #1 Getting the task count of a thread
<?php
use pht\Thread;
$thread = new Thread();
$thread->addFunctionTask(function (){});
$thread->addFunctionTask(function (){});
$thread->addFunctionTask(function (){});
var_dump($thread->taskCount());
以上例程会输出:
int(3)