Node.UnsafeChildProcess.Safe
- Package
- purescript-node-child-process
- Repository
- purescript-node/purescript-node-child-process
All API below is safe (i.e. does not crash if called)
and independent from options or which
function was used to start the ChildProcess
.
#closeH Source
closeH :: EventHandle UnsafeChildProcess (Exit -> Effect Unit) (EffectFn2 (Nullable Int) (Nullable KillSignal) Unit)
#exitH Source
exitH :: EventHandle UnsafeChildProcess (Exit -> Effect Unit) (EffectFn2 (Nullable Int) (Nullable KillSignal) Unit)
#pid Source
pid :: UnsafeChildProcess -> Effect (Maybe Pid)
The process ID of a child process. Note that if the process has already exited, another process may have taken the same ID, so be careful!
#pidExists Source
pidExists :: UnsafeChildProcess -> Effect Boolean
Note: this will not work if the user does not have permission to kill
a PID
. Uses cp.kill(0)
underneath.
#connected Source
connected :: UnsafeChildProcess -> Effect Boolean
Indicates whether it is still possible to send and receive messages from the child process.
#disconnect Source
disconnect :: UnsafeChildProcess -> Effect Unit
Closes the IPC channel between parent and child.
#kill' Source
kill' :: KillSignal -> UnsafeChildProcess -> Effect Boolean
#killSignal Source
killSignal :: Signal -> UnsafeChildProcess -> Effect Boolean
Send a signal to a child process. In the same way as the unix kill(2) system call, sending a signal to a child process won't necessarily kill it.
The resulting effects of this function depend on the process
and the signal. They can vary from system to system.
The child process might emit an "error"
event if the signal
could not be delivered.
#signalCode Source
signalCode :: UnsafeChildProcess -> Effect (Maybe String)