Amp\Parallel\Context\Process classProcess implementsAmp\Parallel\Context\Context

Summary

Properties

Methods

Properties

Methods

run —public functionrun(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 functionstart()

Starts the execution context.

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

Send a signal to the process.

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

Returns a promise resolving to the process PID.

kill —public functionkill()

Immediately kills the context.