Elixir/Ports and external process wiring: Difference between revisions

Adamw (talk | contribs)
c/e first page
Adamw (talk | contribs)
more aside
Line 6: Line 6:
My exploration begins while writing a beta-quality library for Elixir to transfer files in the background and monitor progress, using rsync.
My exploration begins while writing a beta-quality library for Elixir to transfer files in the background and monitor progress, using rsync.


{{Aside|text=[[w:rsync|Rsync]] is usually the best tool for file transfer, locally or over a network.  It can resume incomplete transfers and synchronize directories efficiently, and it's complex enough that nobody is reimplementing it in pure Erlang any time soon.}}
{{Aside|text=[[w:rsync|Rsync]] is the best tool for file transfers, locally or over a network.  It can resume incomplete transfers and synchronize directories efficiently, and after almost 30 years of usage it can be trusted to handle all the edge cases.
<br>
BEAM is a fairly unique ecosystem in which the philosophy is to constantly reinvent a rounder wheel: it's common to port external dependencies into native Erlang, but the complexity of rsync and its dependence on a matching remote daemon makes it unlikely that it will be rewritten any time soon, which is why I've decided to wrap external command execution in a library.}}


I was excited to learn how to interface with long-lived external processes—and this project offered more than I hoped for.
I was excited to learn how to interface with long-lived external processes—and this project offered more than I hoped for.