B
B
bernex2015-08-05 20:26:44
.NET
bernex, 2015-08-05 20:26:44

How to make a task queue with a callback in C#?

I want to do something like this in the code:
I want to add to the job queue (values) at any time

var que = new CallbackQueque<string>();
que.doTask += (str, callback) => { doSomeWork(); callback(); }; 
que.Add("one");
que.Add("two");
//в любое время
que.Add("three");

Tasks are executed in order, but the next one is moved only when the callback is fired.
What are the ready-made solutions for this and what does it look like?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Lastochkin, 2015-08-06
@lasalas

ObservableCollection<T>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question