Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackStacking work

Descripción

publicWorker::stack(Threaded&$work): int

Appends the new work to the stack of the referenced worker.

Parámetros

work

A Threaded object to be executed by the worker.

Valores devueltos

The new size of the stack.

Ejemplos

Ejemplo #1 Stacking a task for execution onto a worker

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

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

El resultado del ejemplo sería:

int(1)
To Top