PHP 7.2.0 Release Candidate 4 Released

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackStacking work

Описание

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

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

Список параметров

work

A Threaded object to be executed by the worker.

Возвращаемые значения

The new size of the stack.

Примеры

Пример #1 Stacking a task for execution onto a worker

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

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

Результат выполнения данного примера:

int(1)

add a note add a note

User Contributed Notes

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