run_erl and heart

Erlang is more than the standard library and virtual machine. As you might expect after thirty years of history, it ships with many tools for successfully running Erlang in production. Two of those tools are run_erl and heart.

Managing Shared I/O

run_erl[83] helps you manage the standard input and output of a program. The Unix tool redirects all output to log files. For those so inclined, there’s a similar Windows tool named start_erl.[84]

run_erl expects a pipe name, the log directory, and the command to execute. Remember the log directory must be created before you invoke run_erl, otherwise it will silently fail. Let’s give run_erl a try:

 $ ​​mkdir​​ ​​./log
 $ ​​run_erl​​ ​​./loop​​ ​​./log​​ ​​"elixir -e 'Enum.map Stream.interval(1000), ...

Get Adopting Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.