PHP Conference Nagoya 2025

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackStacking work

Açıklama

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

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

Bağımsız Değişkenler

work

A Threaded object to be executed by the worker.

Dönen Değerler

The new size of the stack.

Örnekler

Örnek 1 Stacking a task for execution onto a worker

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

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

Yukarıdaki örneğin çıktısı:

int(1)

add a note

User Contributed Notes

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