pthreads Worker::stack

(PECL pthreads >= 2.0.0)

Worker::stack — Stacking work


설명

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

참조된 작업자의 스택에 새 작업을 추가합니다.


매개변수

work
worker가 실행할 Threaded 개체입니다.

반환 값

The new size of the stack.


Examples

예제 #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)