I'm trying to understand how Elixir's
Port works. I'd like to interact with another command that's run and communicate over
:stdio and detect when the other proccess ends in order to gracefully handle it. In my actual application, I'll send input to
the other process, get the result and check it. If it's good, I'll repeat. However, if the other process exits after sending any
result, my program should take some actions and then exit its self. This is meant to be normal behavior, not an error.
However, when I run the below toy script, I'm getting errors trying to deal with the other process exiting. The 3 other
processes I wrote are meant to read one line, echo it back, then exit, while the toy script has 3 items to deal with (it should
just do the first, then report exit and end).
Here's how it's running on my system: