O'Reilly logo

Adopting Elixir by Jose Valim, Bruce Tate, Ben Marx

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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), ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required