I'm in Azure Web Job context. I have to run a job every five minutes (by default, it will be a configuration paramenter) that read some resources from a sql server and post them to an external server via rest API. Resources are in medical context (patients, prescription,medical devices, etc). The requirements are:
- parallel processing of N resources must be allowed by each job execution, where N is a configuration parameter. So,resources are five. If N = 2, will processed in cascade 2 + 2 + 1 resorces.
- each resource can be processed by just a job at time. This means that if a job finds some resources occupied by the previous job, must try to process N others.
Process a resource means read from database (based on a timestamp) and post to external server. I'm quite new with multithreading with C#. Is there any suggestion regarding the solutions to implement this requirements?