Elixir/Ports and external process wiring: Difference between revisions

Adamw (talk | contribs)
Adamw (talk | contribs)
Line 89: Line 89:
== Problem: runaway processes ==
== Problem: runaway processes ==
[[File:CargoNet Di 12 Euro 4000 Lønsdal - Bolna.jpg|thumb]]
[[File:CargoNet Di 12 Euro 4000 Lønsdal - Bolna.jpg|thumb]]
What this means is that rsync transfers would continue to run in the background even after Elixir had completely shut down, because the BEAM had no way of stopping the process.
What this means is that rsync transfers would continue to run in the background even after Elixir had completely shut down, because the BEAM has no way of stopping the process.


To check whether this was something specific to rsync, I tried the same thing with <code>sleep 60</code> and I found that it behaves exactly the same way, hanging until the sleep ends naturally regardless of what happened in Elixir or whether its pipes are still open.
To check whether this was something specific to rsync, I tried to open a Port spawning the command <code>sleep 60</code> and I found that it behaves exactly the same way, hanging until the sleep ends naturally regardless of what happened in Elixir or whether its pipes are still open.


== Bad assumption: pipe-like processes ==
== Bad assumption: pipe-like processes ==