PHP 8.6.0 Beta 1 is available for testing

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackApila la tarea

Descripción

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

Añade la nueva tarea a la pila del worker referenciado.

Parámetros

work
Objeto Threaded a ejecutar por el worker.

Valores devueltos

El nuevo tamaño de la pila.

Ejemplos

Ejemplo #1 Apilamiento de una tarea para ejecución en un worker

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

El ejemplo anterior mostrará:

int(1)

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /