I have code that is already asynchronous - just not using the Task system. I would like to make this an easy task, if possible, so that the code can use it as a task.
So, I want to accept this:
void BeginThing(Action callback);
And turn it into this pseudo code:
Task MyBeginThing() {
Task retval = // what do I do here?
BeginThing(() => retval.Done())
return retval;
}
Is it possible? I do not want to use a mutex and another thread as a solution.
source
share