I am looking for a reliable and easy pattern to consume (execute) background tasks in .net core in parallel.
I found this https://stackoverflow.com/a/49814520/1448545 answer, but the problem is there is always single consumer of the tasks.
What if there is 1 new task to perform per 100ms, while each task takes 500ms to complete (e.g. long running API call). In such case the tasks will pile up.
How to make it dynamic, so if there is more items in BlockingCollection<TaskSettings> _tasks
the .net core will create more tasks executors (consumer) dynamically?