c# - Await async TaskEx -


what taskex? in http://www.i-programmer.info/programming/c/1514-async-await-and-the-ui-problem.html?start=1 or await taskex.delay or await async clarification. use

task dowork() {     return task.run(() =>     {         (int = 0; < 30; i++)         {             thread.sleep(1000 * 60 * 30);         }     }); } 

examples use this

task dowork() {    return taskex.run(() =>    {      (int = 0; < 10; i++)      {          thread.sleep(500);      }    }  }); 

i call await dowork(); if use task, await returns nothing , there no response. if use taskex says doesn't exist in context. should taskex class or sort of function? fists 1 works it's mistake.

taskex class shipped ctps of async/await extensions c# 5 before .net 4.5 shipped... , part of async targeting pack (aka microsoft.bcl.async nuget package) in case want use async/await targeting .net 4.0 (which doesn't have of code required it).

if you're using .net 4.5 or later, use task.run, same thing. (you won't using targeting pack, won't have taskex.) async targeting pack can't add static method existing task class, hence need taskex existing @ all.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -