ContextWorkerFactory
in package
implements
WorkerFactory
uses
ForbidCloning, ForbidSerialization
FinalYes
The built-in worker factory type.
Table of Contents
Interfaces
- WorkerFactory
- Interface for factories used to create new workers.
Constants
- SCRIPT_PATH = __DIR__ . "/Internal/task-runner.php"
Properties
- $bootstrapPath : string|null
- $contextFactory : ContextFactory|null
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- create() : Worker
- The type of worker created depends on the extensions available. If multi-threading is enabled, a WorkerThread will be created. If threads are not available a WorkerProcess will be created.
- __clone() : mixed
Constants
SCRIPT_PATH
public
mixed
SCRIPT_PATH
= __DIR__ . "/Internal/task-runner.php"
Properties
$bootstrapPath read-only
private
string|null
$bootstrapPath
= null
$contextFactory read-only
private
ContextFactory|null
$contextFactory
= null
Methods
__construct()
public
__construct([string|null $bootstrapPath = null ][, ContextFactory|null $contextFactory = null ]) : mixed
Parameters
- $bootstrapPath : string|null = null
- $contextFactory : ContextFactory|null = null
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
nevercreate()
The type of worker created depends on the extensions available. If multi-threading is enabled, a WorkerThread will be created. If threads are not available a WorkerProcess will be created.
public
create([Cancellation|null $cancellation = null ]) : Worker
Parameters
- $cancellation : Cancellation|null = null
Return values
Worker —The newly created worker.
__clone()
protected
final __clone() : mixed