InvokedProcess
class InvokedProcess implements InvokedProcess
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
Methods
Stop the process if its output callback fails.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a new invoked process instance.
Get the process ID if the process is still running.
Get the command line for the process.
Send a signal to the process.
Stop the process if it is still running.
Determine if the process is still running.
Get the standard output for the process.
Get the error output for the process.
Get the latest standard output for the process.
Get the latest error output for the process.
Ensure that the process has not timed out.
Wait for the process to finish.
Wait until the given callback returns true.
Flush all static state.
Details
in
GuardsProcessOutput at line 17
protected Closure|null
guardProcessOutput(Process $process, callable|null $output)
Stop the process if its output callback fails.
in
Macroable at line 30
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 44
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 61
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 72
static void
flushMacros()
Flush the existing macros.
Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 83
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 108
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 28
__construct(Process $process)
Create a new invoked process instance.
at line 35
int|null
id()
Get the process ID if the process is still running.
at line 43
string
command()
Get the command line for the process.
at line 53
InvokedProcess
signal(int $signal)
Send a signal to the process.
at line 63
int|null
stop(float $timeout = 10, int|null $signal = null)
Stop the process if it is still running.
at line 86
bool
running()
Determine if the process is still running.
at line 94
string
output()
Get the standard output for the process.
at line 102
string
errorOutput()
Get the error output for the process.
at line 110
string
latestOutput()
Get the latest standard output for the process.
at line 118
string
latestErrorOutput()
Get the latest error output for the process.
at line 128
void
ensureNotTimedOut()
Ensure that the process has not timed out.
at line 142
ProcessResult
wait(callable|null $output = null)
Wait for the process to finish.
at line 160
ProcessResult
waitUntil(callable|null $output = null)
Wait until the given callback returns true.
at line 180
static void
flushState()
Flush all static state.