« Worker::shutdown
Worker::unstack »

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stack — Stacking work

説明

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

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)
関連キーワード:
work   Worker   stack   worker   Stacking   Threaded   shutdown   unstack   pthreads   Appends   referenced   executed   size   task   execution   onto   extends   dump
関連する関数・ページ:
worker.unstack   worker.shutdown   worker.getstacked   class.worker   worker.isshutdown   worker.collect