Search code examples
c#sequentialorchestration

C# Libraries for timed actions


do you know of any C# libraries that allow you to sequence a series of actions, ie. each action executing when the previous has finished, or better yet, after a specific time interval has occurred.

Thank you.


Solution

  • Look at http://msdn.microsoft.com/en-us/library/dd537609.aspx

    The Task.ContinueWith method let you specify a task to be started when the antecedent task completes.

    Example

    var task = Task.Factory.StartNew(() => GetFileData())
                                           .ContinueWith((x) => Analyze(x.Result))
                                           .ContinueWith((y) => Summarize(y.Result));