Treatment spawnTerminable

process/exec::spawnTerminable


Inputs

⇥ commands: Stream<Command> (process/command::Command)
⇥ environment: Block<Option<Environment>> (process/environment::Environment)
⇥ executor: Block<Executor> (process/exec::Executor)
⇥ terminate: Block<void>

Outputs

↦ completed: Block<void>
↦ error: Block<string>
↦ exit: Stream<Option<i32>>
↦ failed: Block<void>
↦ finished: Block<void>
↦ started: Block<void>
↦ stderr: Stream<byte>
↦ stdout: Stream<byte>
↦ terminated: Block<void>


Spawn commands and provides outputs of the process.

Takes an Executor on which commands will be spawned with the optional environment.

stdout corresponds to the standard output, and stderr to the standard error output.

When the execution finishes, finished is emitted, regardless of the execution or command status. completed is emitted if the command execution went right from executor perspective (the command itself may have failed in its own logic), and exit contains the return code of the command. failed is emitted if the executor is not able to launch the command, and error contains the associated error message. If terminate signal is received, the executor stops as soon as possible the process, and terminated is then emitted. In that case finished is also emitted but not failed or completed.