News for hackers. Stuff that matters.
Re:Asynchronous Programming with Async and Await (C# and Vis... by nathanwdavis on Thursday September 29, 2011 @03:35PM (#3053899)
From what I've heard, you can't use Task<T> for WinRT components that expose async methods. Instead you have to use IAsyncOperation as the return type. This limitation seems kind of annoying IMHO.

Reference: Miguel de Icaza's blog post http://tirania.org/blog/archive/2011/Sep-15.html

Re:Asynchronous Programming with Async and Await (C# and Vis... by varunsrin on Thursday September 29, 2011 @11:55PM (#3055596)
So after toying with it for a couple of hours, here's what I've seen:

I think if the method is named 'Async' (such as GetReplyAsync() *) , you can call it asynchronously with the new await in C#, and using Task<T> as the return type. Only methods that are lableled async implement the new 'await'.

Some of the old .NET methods had 2 API's - synchronous & asyncrhonous. Some of the synchronous implementations, as pointed out in your link, have been deprecated.

A few of the async methods I have seen (which do not have Async in the title), only accept the old IAsync/callback and do not work with await. Presumably, they do not implement the new C#5 style of async yet. Hopefully, they will at some point, because I'm a big fan of how clean & readable async C# can be now.

Again I haven't explored C#5.0 thoroughly, these are just my first impressions.

Re:Asynchronous Programming with Async and Await (C# and Vis... by kenjackson on Thursday September 29, 2011 @04:25PM (#3054125)
Only if you're doing C++. If you're in C#/VB, you still use Task.

http://msdn.microsoft.com/en-us/library/windows/apps/hh46492...

I think that's because the TPL doesn't exist for C++.