An interface for a parallel worker thread that runs a queue of tasks.
Checks if the worker is running.
True if the worker is running, otherwise false.
Checks if the worker is currently idle.
True if the worker is idle, otherwise false.
Starts the context execution.
Worker::enqueue(Task $task): \Generator<mixed>
Enqueues a task to be executed by the worker.
- The task to enqueue.
Generator that resolves with the task return value.
Generator that resolves with the underlaying context's exit code.
Immediately kills the worker and the underlaying context.Next: Worker\WorkerFactory