I have a fire-and-forget Web Service that processes incoming requests. The request needs to go through number of processes that interact with the database via a single-threaded TPL pipeline.
If any process fails the message should be retried but it should be placed at the end of that block's queue. In other words the retry shouldn't be handled by the delegate; it should go to the back of the line (with its retry counter incremented).
Does TPL have this type of functionality built-in or do I need to code it myself?
Would something like this work?
// Proceed if the operation was successful
_firstProcess.LinkTo(_secondProcess, linkOptions, m => m.Succeeded == true);
// Go back to the beginning if it failed
_firstProcess.LinkTo(_firstProcess, linkOptions, m => m.Succeeded == false);
...
// Apply the same to every block.