functions.php
Table of Contents
Functions
- workerPool() : WorkerPool
- Gets or sets the global worker pool.
- submit() : Execution<TReceive, TSend>
- getWorker() : Worker
- Gets an available worker from the global worker pool.
- createWorker() : Worker
- Creates a worker using the global worker factory.
- workerFactory() : WorkerFactory
- Gets or sets the global worker factory.
Functions
workerPool()
Gets or sets the global worker pool.
workerPool([WorkerPool|null $pool = null ]) : WorkerPool
Parameters
- $pool : WorkerPool|null = null
-
A worker pool instance.
Return values
WorkerPool —The global worker pool instance.
submit()
submit(Task<TReceive, TSend> $task[, Cancellation|null $cancellation = null ]) : Execution<TReceive, TSend>
Parameters
- $task : Task<TReceive, TSend>
-
The task to execute.
- $cancellation : Cancellation|null = null
-
Token to request cancellation. The task must support cancellation for this to have any effect.
Tags
Return values
Execution<TReceive, TSend>getWorker()
Gets an available worker from the global worker pool.
getWorker() : Worker
Return values
WorkercreateWorker()
Creates a worker using the global worker factory.
createWorker() : Worker
Return values
WorkerworkerFactory()
Gets or sets the global worker factory.
workerFactory([WorkerFactory|null $factory = null ]) : WorkerFactory
Parameters
- $factory : WorkerFactory|null = null