Stacking work

# Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stack — Stacking work

### Descrierea

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

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

### Parametri

`work`

  A Threaded object to be executed by the worker.

### Valorile întoarse

The new size of the stack.

### Exemple

Example #1 Stacking a task for execution onto a worker

`<?php
$worker = new Worker();
$work = new class extends Threaded {};
var_dump($worker->stack($work));`

Exemplul de mai sus va afișa:

    int(1)