C # Libraries for Temporary Activities

Do you know about any C # libraries that allow you to consistently series of actions, i.e. each action is performed when the previous one is completed, or even better, after a certain time interval.

Thanks.

+4
source share
3 answers

Take a look at http://msdn.microsoft.com/en-us/library/dd537609.aspx

The Task.ContinueWith let function, you specify the task to be run when the antecedent task is completed.

Example

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

for timing quartz.net . for synchronization of actions use, for example. events waithandles , Monitor.Wait() and Monitor.Pulse() ...

otherwise, you can handle many actions, for example

 var methods = new List<Func> { FooMethod1, FooMethod2 } foreach (var method in methods) { method.Invoke(); } 

but this only makes sense if you do not have a moderator method (sequential processing) or your methods should not know about each other.

+2
source

For scheduled tasks, you are looking for a library that supports cron jobs. Here is the one I used in the project.

http://blog.bobcravens.com/2009/10/an-event-based-cron-scheduled-job-in-c/

There are many libraries. I found that many of them are rich and a little heavy.

Hope this helps.

Bean

0
source

All Articles