akash-akya / ex_cmd

ExCmd is an Elixir library to run external programs and to communicate with back pressure
MIT License
65 stars 3 forks source link

Provide collectable and enumerable interface to process communication #1

Closed akash-akya closed 4 years ago

akash-akya commented 4 years ago

These interface handles process management and simplifies the interface

proc_stream = ExCmd.stream!("cat")

Task.async(fn ->
    Stream.map(1..1000, fn _ -> "hello" end)
    |> Enum.into(proc_stream)
end)

output = Enum.into(proc_stream, "")