Sometimes it is required to run multimple tasks in the background, while one
task can only start after another has finished. In this case a simple background
queue based on the C# TPL can be used.
Most of the time a simple Task.Run() can be used to do work on the
background thread pool. But when one has to process multiple tasks one after the
other this does not work any more since using Task.Run() does not guarantee any
order for the processed tasks.
In this case the following code can be used to have a background queue and
execute tasks one after the other.