PHP 8.4.2 Released!

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackStacking work

Descrição

public Worker::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.

Valor Retornado

The new size of the stack.

Exemplos

Exemplo #1 Stacking a task for execution onto a worker

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

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

O exemplo acima produzirá:

int(1)

adicione uma nota

Notas Enviadas por Usuários (em inglês)

Não há notas de usuários para esta página.
To Top