GoLang Worker::stack

request it (397)
GoLang replacement for PHP's Worker::stack [edit | history]



Do you know a GoLang replacement for PHP's Worker::stack? Write it!

PHP Worker::stack

PHP original manual for Worker::stack [ show | php.net ]

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)