So I’m doing some coding for a library that I hope to release soon that will give you all the important plumbing for making Twitter calls for WinRT apps. It leverages ideas from the Flickr library I recently updated for WinRT a couple of posts ago.
This time however I planned to re-write the plumbing to use more native WinRT concepts like the Async/Await pattern.
The networking libraries that we’ve all become accustomed to are the HttpWebRequest / HttpWebResponse which uses IAsyncResult/AsyncCallback and Actions, however these aren’t wired up to take advantage of the async/await pattern.
The equivalent of these networking libraries that does have the async/await pattern built in is the HttpClient.
So I rewrote some key low level methods to use this new class and leverage the new async/await pattern… It was a beautiful experience, the pattern and the class definitely have become a favorite of mine !!
(click picture to see the larger more visible code bits)