So far, we've learned about the basics of queuing and how to delay jobs. Now, we're going to design a solution to a problem regarding asynchronous APIs. The problem is that we want to build a system that can handle requests for the following scenarios:
- The server should save information to the database as one operation.
- It should send an email to the given email address.
- It should perform a long-running job and POST the result to a callback. This is known as a web-hook.
Let's say these three operations are asynchronous and long-running. We need a mechanism to facilitate a long-running process that has the following characteristics:
- The client can fire an API and receive a job ID back.
- The job is pushed onto a queue with the respective message format.
- A worker picks the job and starts performing it.
- Finally, the worker saves the result...