Build Your Optional Server
One of the trickiest parts of learning a concurrency-based language like Elixir is understanding when to use processes at all. Here’s a little guidance. Consider processes when these use cases show up:
-
Sharing state across processes
-
Presenting a uniform API for external services such as databases or communications
-
Managing side effects such as logging or file I/O
-
Monitoring system-wide resources or performance metrics
-
Isolating critical services from failure
This short list is not exhaustive, but it should give you a sense for the types of things that should prompt you to think about a boundary. In short, our boundary is an optional layer of impure integration code that make the core fast, robust, and reliable.
For ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access