Worker::stack
(PECL pthreads >= 2.0.0)
Worker::stack — 将要执行的任务入栈
参数
-
work
-
要被 Worker 执行的 Threaded 派生对象
返回值
入栈之后,Worker 对象栈的大小。
范例
示例 #1 向 Worker 中入栈任务并执行
<?php
$worker = new Worker();
$work = new class extends Threaded {};
var_dump($worker->stack($work));
以上例程会输出:
int(1)

User Contributed Notes
There are no user contributed notes for this page.