StartProcess¶
Fork+exec (posix) or create (windows) a child process and return a live
ProcessMonitor for it, or a ProcessError if the process could not be
started. Every fallible step of starting the process happens here, before the
monitor exists, so a returned ProcessMonitor is always monitoring a running
child. Use it in place of a constructor:
match StartProcess(sp_auth, bp_auth, consume notifier, path, args, vars)
| let pm: ProcessMonitor => // a live child is running
| let err: ProcessError => // never started; err says why
end
On a ProcessError return, no process was started and none of the notifier's
callbacks will fire. On Linux, starting a process requires kernel 5.3 or
newer; on an older kernel, StartProcess returns an UnsupportedKernel
error.
Constructors¶
create¶
Returns¶
- StartProcess val^
Public Functions¶
apply¶
Start a child process running the executable at path.
fun box apply(
auth: StartProcessAuth val,
backpressure_auth: ApplyReleaseBackpressureAuth val,
notifier: ProcessNotify iso,
path: FilePath val,
args: Array[String val] val,
vars: Array[String val] val,
wdir: (FilePath val | None val) = reference)
: (ProcessMonitor tag | ProcessError val)
Parameters¶
- auth: StartProcessAuth val
- backpressure_auth: ApplyReleaseBackpressureAuth val
- notifier: ProcessNotify iso
- path: FilePath val
- args: Array[String val] val
- vars: Array[String val] val
- wdir: (FilePath val | None val) = reference
Returns¶
- (ProcessMonitor tag | ProcessError val)
eq¶
Parameters¶
- that: StartProcess val
Returns¶
- Bool val
ne¶
Parameters¶
- that: StartProcess val
Returns¶
- Bool val