Chapter 5. Futures

This chapter covers

  • Manipulating futures and handling their failure
  • Using futures correctly in the context of Play
  • Splitting business logic into small pieces suitable for implementing with futures

Futures are at the foundation of asynchronous and reactive programming in Scala: they allow you to manipulate the results of a computation that hasn’t happened yet and to effectively deal with the failure of such computations, enabling more efficient use of computational resources. You’ll encounter futures in many of the libraries you’ll work with in Play and other tools.

This chapter has two parts. First we’ll look at how to work with futures both on a standalone basis and within the context of Play. Second, we’ll take an ...

Get Reactive Web Applications 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.