O'Reilly logo

Mastering Concurrency Programming with Java 8 by Javier Fernández González

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 4. Getting Data from the Tasks – The Callable and Future Interfaces

In Chapter 2, Managing Lots of Threads – Executors, and Chapter 3, Getting the Maximum from Executors, we introduced the executor framework to improve the performance of concurrent applications and showed you how to implement advanced characteristics to adapt this framework to your needs. In these chapters, all the tasks executed by the executor were based on the Runnable interface and its run() method that doesn't return a value. However, the executor framework allows us to execute other kind of tasks that return a result based on the Callable and Future interfaces. In this chapter, we will cover the following topics:

  • An introduction to the Callable and Future interfaces ...

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