This is automatic generated document for things in Swow\Process\ChildProcess class
Class ChildProcess
Methods
Static method fork
Fork the current process and run a closure in the child.
POSIX only. Throws ProcessException on Windows.
Throws ProcessException
Static method spawn
Spawn a command.
stdio defaults to inherit. A pipe returns a PHP stream; a file redirects to the given path; a resource uses the existing stream. Extra child file descriptors can be passed through fds, with child fd keys in the range 3 to 256.
Throws ProcessException when the command cannot be spawned
Method __destruct
Close the process object during destruction.
Internal
Method close
Close the process object.
This never kills the process. Closing a running process abandons it and releases the process handle; the child continues to run. A POSIX child may remain a zombie until the parent exits. Calling close more than once is allowed. After close the object cannot be used for getPid, wait, hasExited, or kill.
Throws ProcessException when another coroutine is waiting
Method getPid
Get the process id.
Method getStderr
Get the parent side of the stderr pipe.
Returns (resource | null) null unless stderr is a pipe
Method getStdin
Get the parent side of the stdin pipe.
Returns (resource | null) null unless stdin is a pipe
Method getStdout
Get the parent side of the stdout pipe.
Returns (resource | null) null unless stdout is a pipe
Method hasExited
Check whether the process has exited.
Method kill
Send a signal to the process.
Windows supports SIGINT, SIGBREAK, and SIGKILL. SIGTERM is not supported on Windows.
Throws ProcessException when the signal cannot be sent
Method wait
Wait for the process to exit.
Param int $timeout timeout in milliseconds, -1 means infinite
Throws ProcessException when waiting fails or times out