O'Reilly logo

Learning .NET High-performance Programming by Antonio Esposito

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous Programming Model (APM)

The Asynchronous Programming Model (APM) is one of the oldest patterns introduced by Microsoft in .NET 1.0 back in 2001 for asynchronous programming handling.

The pattern is easy. To start a deferred job, you simply start such a job by using a Delegate (remote method invoker) and then get an object back of type IAsyncResult to know the status of such a remote operation. Here an asynchronous programmed application to compute file hashes. The application will add a "." to the Starting data computation initial message to acknowledge to the user that the application is still processing. The following examples use the blocking approach:

static void Main(string[] args) { //a container for data var complexData = new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required