Right now, our commands construct a linear chain of pipes. It would be nice if we could do arbitrary DAGs, something along the lines of:
val split : cmd -> cmd * cmd
(** [split] a command into two identical commands that have the same output *)
val as_fifo : cmd -> string
(** take a command and turn it into a named pipe. Similar to <( ... ) in bash. *)
This could be used like so:
let log1, log2 = process "tail" [ "-f" ; "log" ] |> split in
process "cat" [as_fifo (log1 |. shuf); as_fifo (log2 |. sort)] |> run
The named pipes would have to be cleaned up when the Feather.run exits and Stdlib.at_exit.
I looked into this a bit and the most annoying part is that neither Base nor Stdlib implement a way to get the name of a tempfile without actually creating the tempfile. (We want to mkfifo ourselves.) So we'll have to implement our own random tempfile function.
Right now, our commands construct a linear chain of pipes. It would be nice if we could do arbitrary DAGs, something along the lines of:
This could be used like so:
The named pipes would have to be cleaned up when the Feather.run exits and
Stdlib.at_exit.I looked into this a bit and the most annoying part is that neither
BasenorStdlibimplement a way to get the name of a tempfile without actually creating the tempfile. (We want to mkfifo ourselves.) So we'll have to implement our own random tempfile function.