Amp\Parallel\Worker\Worker interface Worker

An interface for a parallel worker thread that runs a queue of tasks.

Summary

Properties

Methods

Methods

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.