PHP 8.3.4 Released!

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackEmpile la tâche

Description

public Worker::stack(Threaded &$work): int

Ajoute la nouvelle tâche à la pile du worker référencé.

Liste de paramètres

work

Objet Threaded à exécuter par le worker.

Valeurs de retour

La nouvelle taille de la pile.

Exemples

Exemple #1 Empilage d'une tâche pour l'exécution sur un worker

<?php
<?php
$worker
= new Worker();
$work = new class extends Threaded {};

var_dump($worker->stack($work));

L'exemple ci-dessus va afficher :

int(1)

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top