PHP 8.5.0 RC 2 available for testing

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stack โ€” Stacking 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