If i have a method that invokes another method in this style:
private void MyMethod()
{
// get a command object in a queue to process.
var currentObject = this.Queue.Pop();
// now call itself recursively for next command object in queue...
Task.Run(async () => {
// begin awaited async execution of the command object...
// end of execution
// do a recursive call once awaited async operation above is done
this.MyMethod();
});
}
I basically have a queue of objects that i need to execute in an asynchronous fashion. Where each consecutive object is not executed until the previous one completes.
Do these recursive calls of async tasks have performance implications and/or negative side effects?