O'Reilly logo

Dart in Action by Chris Buckett

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

Chapter 9. Asynchronous programming with callbacks and futures

This chapter covers

  • The nonblocking async programming model
  • Callbacks for asynchronous APIs
  • Improving asynchronous readability with futures and completers
  • Unit-testing asynchronous code

In web programming, you can’t rely on events outside your application’s control happening in a specific order. In the browser, retrieving data from a server might take longer than you expect, and instead of waiting for the data, a user might click another button. A Dart server application will likely need to handle a new request for data before a previous request has finished reading data from the file system. This type of programming is known as an asynchronous model (async), and its counterpart ...

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