ProcessMonitor
Fork+execs / creates a child process and monitors it. Notifies a client about STDOUT / STDERR events.
actor tag ProcessMonitor
Constructors
create
Create infrastructure to communicate with a forked child process and register the asio events. Fork child process and notify our user about incoming data via the notifier.
new tag create( auth: (AmbientAuth val | StartProcessAuth val), backpressure_auth: (AmbientAuth val | ApplyReleaseBackpressureAuth val), notifier: ProcessNotify iso, filepath: FilePath val, args: Array[String val] val, vars: Array[String val] val, wdir: (FilePath val | None val) = reference, process_poll_interval: U64 val = call) : ProcessMonitor tag^
Parameters
- auth: (AmbientAuth val | StartProcessAuth val)
- backpressure_auth: (AmbientAuth val | ApplyReleaseBackpressureAuth val)
- notifier: ProcessNotify iso
- filepath: FilePath val
- args: Array[String val] val
- vars: Array[String val] val
- wdir: (FilePath val | None val) = reference
- process_poll_interval: U64 val = call
Returns
- ProcessMonitor tag^
Public Behaviours
Print some bytes and append a newline.
be print( data: (String val | Array[U8 val] val))
Parameters
write
Write to STDIN of the child process.
be write( data: (String val | Array[U8 val] val))
Parameters
printv
Print an iterable collection of ByteSeqs.
be printv( data: ByteSeqIter val)
Parameters
- data: ByteSeqIter val
writev
Write an iterable collection of ByteSeqs.
be writev( data: ByteSeqIter val)
Parameters
- data: ByteSeqIter val
done_writing
Set the _done_writing flag to true. If _pending is empty we can close the _stdin pipe.
be done_writing()
dispose
Terminate child and close down everything.
be dispose()
timer_notify
Windows IO polling timer has fired
be timer_notify()
Public Functions
expect
A stdout
call on the notifier must contain exactly qty
bytes. If qty
is zero, the call can contain any amount of data.
fun ref expect( qty: USize val = 0) : None val
Parameters
- qty: USize val = 0
Returns
- None val
© 2016-2020, The Pony Developers
© 2014-2015, Causality Ltd.
Licensed under the BSD 2-Clause License.
https://stdlib.ponylang.io/process-ProcessMonitor