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

Summary

In this chapter, we presented two examples that explored advanced characteristics of executors. In the first example, we continued with the client/server example of Chapter 2, Managing Lots of Threads – Executors. We implemented our own executor extending the ThreadPoolExecutor class to execute the tasks by priority and to measure the executing time of the tasks per user. We also included a new command to allow the cancellation of tasks.

In the second example, we explained how to use the ScheduledThreadPoolExecutor class to execute periodic tasks. We implemented two versions of a news reader. The first one showed how to use the basic functionality of the ScheduledExecutorService, and the second one showed how to override the behavior of ...

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