Quantcast
Channel: Task.ContinueWith does not call 2nd task (only first one is running) - Stack Overflow
Browsing index pages (6 articles)
↧

Task.ContinueWith does not call 2nd task (only first one is running)

My application lets the user create "Task" objects from the UI and set their order of executions. From there, when the user click "run" all of the Tasks (by order) are sent to a class that suppose to...

View Article


Answer by Boas Enkler for Task.ContinueWith does not call 2nd task (only...

Have you checked that the else branch with else m_BatchTask.ContinueWith(prev=>newTask); is called?As I see m_Batch task is initially null when he applies next task to it but does not raise the...

View Article


Answer by Aron for Task.ContinueWith does not call 2nd task (only first one...

To be honest I think you are using Task incorrectly. In most cases Task represents work that is happening already.This is how I would go about writing the code you "want" assuming C#5.public void...

View Article

Answer by NSFW for Task.ContinueWith does not call 2nd task (only first one...

Note that "foo.ContinueWith(completedTask => otherTask);" does not start otherTask. You need something like "foo.ContinueWith(completedTask => otherTask.Start());"Try this in a debugger, that may...

View Article

Answer by galenus for Task.ContinueWith does not call 2nd task (only first...

The problem is in this line:m_BatchTask.ContinueWith(prev=>newTask);I presume the newTask is not started when it's being returned from ident.Create.So you should:if (m_BatchTask != null){...

View Article


Answer by Idan for Task.ContinueWith does not call 2nd task (only first one...

Finally got it to work after merging data from all answers and continuing googling.The working class is:public class MaintenanceTask{ private CancellationTokenSource m_CancellationTokenSource; private...

View Article
Browsing index pages (6 articles)


Latest Images