Amp\Parallel\Context\Process class Process implements Amp\Parallel\Context\Context

Summary

Properties

Methods

Properties

Methods

run — public function run(string|array $script, string|null $cwd = null, array $env = [], string $binary = null): Amp\Parallel\Context\Process

Creates and starts the process at the given path using the optional PHP binary path.

Type Parameter Description Default Value
string|array $script Path to PHP script or array with first element as path and following elements options to the PHP script (e.g.: ['bin/worker', 'Option1Value', 'Option2Value']. none
string|null $cwd Working directory. null
array $env Array of environment variables. []
string $binary Path to PHP binary. Null will attempt to automatically locate the binary. null
__construct — public function __construct(string|array $script, string|null $cwd = null, array $env = [], string $binary = null)
No documentation.
Type Parameter Description Default Value
string|array $script Path to PHP script or array with first element as path and following elements options to the PHP script (e.g.: ['bin/worker', 'Option1Value', 'Option2Value']. none
string|null $cwd Working directory. null
array $env Array of environment variables. []
string $binary Path to PHP binary. Null will attempt to automatically locate the binary. null
start — public function start()

Starts the execution context.

isRunning — public function isRunning(): bool
No documentation.
receive — public function receive(): Amp\Promise
No documentation.
send — public function send($data): Amp\Promise
No documentation.
Type Parameter Description Default Value
mixed $data No documentation. none
join — public function join(): Amp\Promise
No documentation.
signal — public function signal(int $signo)

Send a signal to the process.

Type Parameter Description Default Value
int $signo No documentation. none
getPid — public function getPid(): Amp\Promise

Returns a promise resolving to the process PID.

kill — public function kill()

Immediately kills the context.