Advanced IEx: User Switching, Remote Shells, and More

IEx is Elixir’s interactive shell. It mostly operates similar to an interactive shell for any other programming language. However, given that Elixir/Erlang were designed with distributed systems in mind and view the world in terms of processes, there is some additional functionality that IEx provides.

Firstly IEx has a number of helpers. Some provide information about the current state, such as pwd or ls. Some allow you to alter the context of the current process, such as being able to compile and recompile files in the session. To make development easier, IEx also provides breakpoints and an .iex.exs file that lets you execute some script in the shell when it is opened.

IEx also allows for multiple processes to run with their own context, and you can switch between these from the user switching menu. IEx also has remote shells, to better test functionality that requires multiple Elixir nodes to connect to each other.

In the following video, we’ll cover some helpers, breakpoints, and the .iex.exs file as tools for debugging. We’ll also go over how to manage context with user switching and create a 2 node system with remote shells.

Sign up for our newsletter

Get notified of any new episodes as we release them.

© 2020 QuantLayer, LLC. All rights reserved.