Digests » 136
Manage your design layouts, coding tasks all in one place and easily communicate with your team. Start using the project management tool built for designers and developers. Create your free account →
Let’s say you’re managing complex process state in your Elixir application and you need a way to spin up and down new processes as your app runs. This requirement is known as dynamic supervision, the ability for a supervisor to add processes to its supervision tree at runtime. This post will explain how to implement a process under dynamic supervision with Elixir 1.5, and discuss how Elixir 1.6’s new DynamicSupervisor is easier to configure and is more flexible.
I’ve been amazed at how well Elixir has fared with implementing the algorithms involved in working with Bitcoin keys and addresses. Elixir ships with all the tools required to generate a cryptographically secure private key and transform it into a public address string.
In the previous article, we have learned about MVC and covered a little bit more how to work with Controllers and Views. One piece is still missing. The models. Let’s talk about them now. As we remember the models are responsible for managing the data of the application. We also remember that models should hide the implementation details. In our last task, we have provided the basic page layout and displayed the static list of the rooms on the page. Now it would be nice to get that list from somewhere else.
In Elixir, it’s possible to connect nodes together to form a cluster in which all the nodes are visible to each other. This feature can be used to inspect and debug production apps running on remote nodes. Let’s see how we can connect to an Elixir node running inside a docker container remotely from a local iex shell and use Erlang’s debugger tool to set breakpoints and debug the code running in the remote node.
CQS is a well-known concept from the early age of programming introduced by Bertrand Meyer in the Eiffel language. It says that every action should be either a command (that performs an action) or a query (that returns some data) but not both at the same time. It was devised to draw a clear line between performing mutations and collecting results.