c# - Using tasks when they have all completed -
i have question task.factory.continuewhenall method
here code:
private void checknewresult(){ task.factory.continuewhenall(taskslist.toarray(),completetasks); } private void completetasks(tasks[] tasks) { if(tasks.any(t => t.status == (taskstatus.rantocompletion))) { //do } }
my question when complete tasks method called? when tasks have finished completing requests?
when doing
task.factory.continuewhenall(taskslist.toarray(),completetasks);
documentation states that
creates continuation task started upon completion of set of provided tasks. either in completed state or other.
one possible approach test status of task, , attempt perform continuation if status not faulted or canceled. need this.
if(tasks.any(t => t.status == (taskstatus.rantocompletion)))
Comments
Post a Comment