Worker::stack

Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stackStacking work

Description

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

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

Parameters

work

A Threaded object to be executed by the worker.

Return Values

The new size of the stack.

Examples

Example #1 Stacking a task for execution onto a worker

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

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

The above example will output:

int(1)

© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/worker.stack.php

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部