This optional package provides native threading, multiprocessing, process synchronization, shared memory, and task workers. The package is available on Packagist as
Worker\pool(Pool $pool = null): Pool
Returns the global worker pool for the current context.
- A worker pool instance.
The global worker pool instance.
Worker\enqueue(Task $task): \Generator
Enqueues a task to be executed by the global worker pool.
- The task to enqueue.
Generator that resolves with the task return value.
Creates a worker using the global worker factory.
Worker\factory(WorkerFactory $factory = null): WorkerFactory
Gets or sets the global worker factory.
Gets a worker from the global worker pool.Next: Context