Amp\Parallel\Worker\WorkerThread classWorkerThread extendsAmp\Parallel\Worker\AbstractWorker

A worker thread that executes task objects.

Summary

Properties

Methods

Methods

__construct —public function__construct(string$envClassName =BasicEnvironment::class)
No documentation.
Type Parameter Description Default Value
string $envClassName Name of class implementing \Amp\Parallel\Worker\Environment to instigate. Defaults to \Amp\Parallel\Worker\BasicEnvironment. BasicEnvironment::class
isRunning —public functionisRunning():bool

{@inheritdoc}

isIdle —public functionisIdle():bool

{@inheritdoc}

enqueue —public functionenqueue(Amp\Parallel\Worker\Task$task):Amp\Promise

{@inheritdoc}

Type Parameter Description Default Value
Amp\Parallel\Worker\Task $task No documentation. none
shutdown —public functionshutdown():Amp\Promise

{@inheritdoc}

kill —public functionkill()

{@inheritdoc}

cancel —protected functioncancel(Throwable|null$exception =null)

Cancels all pending tasks and kills the context.

Type Parameter Description Default Value
Throwable|null $exception Optional exception to be used as the previous exception. null