Invoke Your Workers
The workers are the different processes in your component. Generally, you’ll start with a flat design having a single worker and decide where you need to be more sophisticated. As your design evolves you will possibly see places that you need to add workers, for cleaning up lifecycles or for concurrently dividing work. Connection pools are workers; tasks and agents can be as well.
Believe it or not, our Counter component is not the simplest possible. We could have a library with a counter API but no state at all. That program would not have any workers. Our counter has a single worker, one we use to encapsulate state with OTP. Still, we don’t have to yet consider how to efficiently partition work, but Elixir will give us ...
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