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 16
protected Closure|null
guardProcessOutput(Process $process, callable|null $output)
Stop the process if its output callback fails.
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 103
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
at line 25
__construct(Process $process)
Create a new invoked process instance.
at line 32
int|null
id()
Get the process ID if the process is still running.
at line 40
string
command()
Get the command line for the process.
at line 48
InvokedProcess
signal(int $signal)
Send a signal to the process.
at line 58
int|null
stop(float $timeout = 10, int|null $signal = null)
Stop the process if it is still running.
at line 66
bool
running()
Determine if the process is still running.
at line 74
string
output()
Get the standard output for the process.
at line 82
string
errorOutput()
Get the error output for the process.
at line 90
string
latestOutput()
Get the latest standard output for the process.
at line 98
string
latestErrorOutput()
Get the latest error output for the process.
at line 108
void
ensureNotTimedOut()
Ensure that the process has not timed out.
at line 122
ProcessResult
wait(callable|null $output = null)
Wait for the process to finish.
at line 138
ProcessResult
waitUntil(callable|null $output = null)
Wait until the given callback returns true.
at line 156
static void
flushState()
Flush all static state.