WorkerPoolBootstrap
in package
FinalYes
Tags
Table of Contents
Methods
- create() : self
- run() : void
- Start the worker pool. Blocks until the pool exits.
- withHandler() : self
- withLoggerClass() : self
- withOnStart() : self
- Register a main-thread callback to run after all workers are ready.
- withSerializedConfigure() : self
- Serialized opis/closure configure callable. When set, WorkerRunnable runs this instead of the WorkerStartHandler.
- withSerializedLoggerFactory() : self
- Serialized opis/closure factory: Closure(): LoggerInterface.
Methods
create()
public
static create(WorkerPoolConfig $config) : self
Parameters
- $config : WorkerPoolConfig
Return values
selfrun()
Start the worker pool. Blocks until the pool exits.
public
run() : void
withHandler()
public
withHandler(WorkerStartHandler> $handlerClass) : self
Parameters
- $handlerClass : WorkerStartHandler>
Return values
selfwithLoggerClass()
public
withLoggerClass(LoggerInterface>|null $loggerClass) : self
Parameters
- $loggerClass : LoggerInterface>|null
Return values
selfwithOnStart()
Register a main-thread callback to run after all workers are ready.
public
withOnStart(callable(WorkerPoolHandle): void|null $onStart) : self
When set, raw Swoole\Thread instances are used instead of Thread\Pool so the main thread can invoke the callback while workers are running.
Parameters
- $onStart : callable(WorkerPoolHandle): void|null
Return values
selfwithSerializedConfigure()
Serialized opis/closure configure callable. When set, WorkerRunnable runs this instead of the WorkerStartHandler.
public
withSerializedConfigure(string|null $serializedConfigure) : self
Parameters
- $serializedConfigure : string|null
Return values
selfwithSerializedLoggerFactory()
Serialized opis/closure factory: Closure(): LoggerInterface.
public
withSerializedLoggerFactory(string|null $serializedLoggerFactory) : self
Parameters
- $serializedLoggerFactory : string|null