Building a Job-Processing System
In the previous chapter, we used the Task module to start a new process when sending each email. We are going to adopt the same approach for our job-processing system. Rather than having a single GenServer that does all the work, we will start a GenServer process for each job. This will help us leverage concurrency and improve performance.
We also don’t want to lose any features that we have introduced so far in this chapter—we want to be able to retry failed jobs and configure the process to suit our needs. Finally, we will introduce a new type of supervisor to help us manage these processes and provide fault tolerance. The figure will give you a high-level overview of what we’re going to build.
To begin, let’s ...
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