Async C# -- Anyone else in love?

acidhax

New member
Dec 28, 2011
6
0
0
So I just picked up the Async CTP framework for .NET/CF, and I'm amazed at how easy it has made Asynchronous development.

I EASILY fixed a slow load time by moving every data load/sort to an asynchronous thread.

If you haven't, you should check it out!

Code:
private async void GonnaDoThis() 
{
   Boolean isItDoneYet = await ThisIsMyBackgroundThread();
}

private Task<Boolean> ThisIsMyBackgroundThread() 
{
   return TaskEx.Run(() => {
      Console.WriteLine("This was run in the background");
      return true;
   });
}

Easy as that. So cool.
 
Wow, looks pretty cool! I haven't actually played with this release but will at some point. Until then I'm using good old BackgroundWorkers &#55357;&#56843;
 
So I just picked up the Async CTP framework for .NET/CF, and I'm amazed at how easy it has made Asynchronous development.

I EASILY fixed a slow load time by moving every data load/sort to an asynchronous thread.

If you haven't, you should check it out!

Code:
private async void GonnaDoThis() 
{
   Boolean isItDoneYet = await ThisIsMyBackgroundThread();
}

private Task<Boolean> ThisIsMyBackgroundThread() 
{
   return TaskEx.Run(() => {
      Console.WriteLine("This was run in the background");
      return true;
   });
}

Easy as that. So cool.
Yeah. I'm looking forward to it. Most of my day job is ASP.NET MVC, so I'm not sure I'll get much use out of it there. But whenever it makes its way to Windows Phone and whatever we'll have for Windows 8 apps, I'm sure I'll be taking advantage often.
 

Members online

Forum statistics

Threads
339,404
Messages
2,262,425
Members
428,758
Latest member
Doilkakk