Skip to content

StartProcess

[Source]

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.

primitive val StartProcess

Constructors

create

[Source]

new val create()
: StartProcess val^

Returns


Public Functions

apply

[Source]

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

Returns


eq

[Source]

fun box eq(
  that: StartProcess val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: StartProcess val)
: Bool val

Parameters

Returns