Now that we've introduced Redis and the Redis client for Go, let's quickly add the feature of job status to our previously designed asynchronous API. We need to make the following changes to that project:
- Add a new route to collect the job ID from a client
- Add a new handler to fetch the job status from Redis
- Whenever someone adds a new job, we need to write status to Redis in every stage of the job life cycle
We'll create a new project for this feature. It has a similar structure to longRunningTaskV1, which we created previously. The code and files are the same. You can clone the project and rename it longRunningTaskV2.
Let's take a look at the implementation, which includes dependency installs and modifications ...