C# - Parallel.ForEach and Async combination -
i've problem parallel.foreach , async combination. here code -
new thread(() =>{ //doing stuff here parallel.foreach(.....,paralleloption,async(j,loopstate) => { //await stuff here like: // httpresponsemessage res = await httpclient.getasync(url); // updateui } }).start();
now, problem how can sure of loop has completed jobs? ends in few seconds uiupdateing continue more time. how possible wait await httpclient.getasync(url)
complete , update ui?
using async/await multiple tasks
return task.whenall(ids.select(i => dosomething(1, i, blogclient)));
i don't know what's in actual loop code. if put more can make more specific. though use whenall await of ascnc tasksf
Comments
Post a Comment