Php/docs/pht-thread.taskCount

From Get docs
Revision as of 08:24, 9 December 2020 by Notes (talk | contribs) (autoload)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

pht\Thread::taskCount

(PECL pht >= 0.0.1)

pht\Thread::taskCountGets a thread's task count


Description

public pht\Thread::taskCount ( ) : int

Retrieves the current task count of a pht\Thread.


Parameters

This function has no parameters.


Return Values

The number of tasks remaining to be processed.


Examples

Example #1 Getting the task count of a thread

<?phpuse pht\Thread;$thread = new Thread();$thread->addFunctionTask(function (){});$thread->addFunctionTask(function (){});$thread->addFunctionTask(function (){});var_dump($thread->taskCount());

The above example will output:


int(3)