Using Asynchronous programming to manage parallel processing
Background
There was a requirement to perform series of tasks, involving generation of output files, such that the required throughput is achieved. These tasks involve database read operation, external API invocation and file i/o. Generally, benchmarking showed that executing them in sequential way was not helpful. What if asynchronous programming be used to perform this task.
So Lets Start.
Approach
Lets assume that this typical use case requires,
fetching data from database for the purpose of merging placeholders in a Template and perform mail merge