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

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -