I was trying to implement a class that would run value returning methods sequentially. I want to be able to call same instance RunScheduled
method from multiple threads, and scheduled tasks to execute on single thread. Any scheduled method should start executing only after previous has completed.
public class TaskSequencer
{
public Task<T> RunScheduled(Func<T> func)
{
//?
}
}
How can I achieve that ?