CHAPTER 7

image

async and await

In view of Windows 8’s mantra of “Fast and Fluid,” it has never been more important to ensure that UIs don’t stall. To ensure that UI developers have no excuses for not using asynchronous methods, the C# language introduces two new keywords: async and await. These two little gems make consuming and composing asynchronous methods as easy as their synchronous counterparts.

This chapter is a story of two parts. The first part explains how easy asynchronous programming can be in C# 5, while the second part is a deep dive into the compiler magic behind the keywords. The second part may not be for everyone, so feel free to ...

Get Pro Asynchronous Programming with .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.