Async 12: Expressions within await

Update:  Thanks to Jon Skeet, the description of what can be awaited is more accurate. After a brief spring hiatus, it’s time to continue examining the Async samples provided by Lucian Wishik. The next set of samples shows how the await keywor…

Read more >> Async 12: Expressions within await

async 11: Control Flow and await

The next set of Async samples shows how the await keyword integrates into the familiar control flow constructs in the C# language. There are seven different samples in this section, and I won’t show all of them. Again, I’ll encourage you to visit L…

Read more >> async 11: Control Flow and await

Async 10: Switching Threads

It’s time for another look at the upcoming async features in C#. This time it’s different ways to control switching threads. My preferred way to switch threads is to use the TaskEx.Run() method. You write a lambda expression for the work to be don…

Read more >> Async 10: Switching Threads

async samples 9: Migration from Existing APIs

The ninth set of samples discusses migrating existing asynchronous programming models to the upcoming async syntax.  The first sample shows how you can wrap code that uses the existing Asynchronous Programming Model library to use the new async fe…

Read more >> async samples 9: Migration from Existing APIs

async 8: creating combinators

These samples use the concepts from the last sample to handle situations where an async operation does not complete as quickly as users might expect.  The first sample shows you how to handle the situation where an async operation should be cancel…

Read more >> async 8: creating combinators

async samples 7: Combinators

This next set of async samples discusses techniques that enable you to build workflows of the form “do this asynchronously, and then, when this finishes, do that”. The first example shows how to start several tasks in parallel, and continue when al…

Read more >> async samples 7: Combinators

async Samples 6: Declaring async methods

So far, we’ve only discussed calling async methods. The next set of samples discusses how to declare async methods. I’m going to discuss these three samples in a different order than they appear on Lucian’s site. I think a different order will m…

Read more >> async Samples 6: Declaring async methods

async Samples 5: Exceptions and async methods

To some degree, the async samples present an overly simplified view of exception handling in async methods. Despite that, it is a good overview of how the team wanted to make the async methods behave as much like serial methods as possible. First, exce…

Read more >> async Samples 5: Exceptions and async methods

WCF Async Without Changing The Contract

Someone asked a group of people recently about how to prevent overloading a WCF service that gets blocked. It sounded like the WCF service was getting called a lot and this was causing many threads to get created to service … Continue reading

Read more >> WCF Async Without Changing The Contract

Async Samples 4: Reporting progress

The next async samples explore how to report progress while async operations execute. There’s only one sample here, but it’s somewhat more involved.  The client method (calling async methods) method follows: public async Task AsyncProgres…

Read more >> Async Samples 4: Reporting progress