ProcessNotify

[Source]

Notifications for Process connections.

interface ref ProcessNotify

Public Functions

created

[Source]

ProcessMonitor calls this when it is created.

fun ref created(
  process: ProcessMonitor ref)
: None val

Parameters

Returns

stdout

[Source]

ProcessMonitor calls this when new data is received on STDOUT of the forked process

fun ref stdout(
  process: ProcessMonitor ref,
  data: Array[U8 val] iso)
: None val

Parameters

Returns

stderr

[Source]

ProcessMonitor calls this when new data is received on STDERR of the forked process

fun ref stderr(
  process: ProcessMonitor ref,
  data: Array[U8 val] iso)
: None val

Parameters

Returns

failed

[Source]

ProcessMonitor calls this if we run into errors communicating with the forked process.

fun ref failed(
  process: ProcessMonitor ref,
  err: ProcessError val)
: None val

Parameters

Returns

expect

[Source]

Called when the process monitor has been told to expect a certain quantity of bytes. This allows nested notifiers to change the expected quantity, which allows a lower level protocol to handle any framing.

fun ref expect(
  process: ProcessMonitor ref,
  qty: USize val)
: USize val

Parameters

Returns

dispose

[Source]

Call when ProcessMonitor terminates to cleanup ProcessNotify. We return the exit status of the child process, it can be either an instance of Exited if the process finished. The childs exit code can be retrieved using Exited.exit_code().

On Posix systems, if the process has been killed by a signal (e.g. through the kill command), child_exit_status will be an instance of Signaled with the signal number that terminated the process available via Signaled.signal().

fun ref dispose(
  process: ProcessMonitor ref,
  child_exit_status: (Exited val | Signaled val))
: None val

Parameters

Returns

© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/process-ProcessNotify