Amp\Parallel\Worker\Internal\PooledWorker class PooledWorker implements Amp\Parallel\Worker\Worker

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(Amp\Parallel\Worker\Worker $worker, callable $push)
No documentation.
Type Parameter Description Default Value
Amp\Parallel\Worker\Worker $worker No documentation. none
callable $push Callable to push the worker back into the queue. none
__destruct — public function __destruct()

Automatically pushes the worker back into the queue.

isRunning — public function isRunning(): bool

Checks if the worker is running.

isIdle — public function isIdle(): bool

Checks if the worker is currently idle.

enqueue — public function enqueue(Amp\Parallel\Worker\Task $task): Amp\Promise
No documentation.
Type Parameter Description Default Value
Amp\Parallel\Worker\Task $task No documentation. none
shutdown — public function shutdown(): Amp\Promise
No documentation.
kill — public function kill()

Immediately kills the context.