GoLang pht\Thread::taskCount

request it (349)
GoLang replacement for PHP's pht\Thread::taskCount [edit | history]



Do you know a GoLang replacement for PHP's pht\Thread::taskCount? Write it!

PHP pht\Thread::taskCount

PHP original manual for pht\Thread::taskCount [ show | php.net ]

pht\Thread::taskCount

(PECL pht >= 0.0.1)

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

Description

public int pht\Thread::taskCount ( void )

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

<?php

use 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)