pht\Thread::taskCount

(PECL pht >= 0.0.1)

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

Description

public pht\Thread::taskCount ( void ) : int

Retrieves the current task count of a pht\Thread.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

The number of tasks remaining to be processed.

Exemples

Exemple #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());

L'exemple ci-dessus va afficher :

int(3)