Simple play icon Course

Asynchronous Programming in Java SE 17

by Jose Paumard

Java SE 17 comes with its own asynchronous programming model. This course shows you how you can leverage this API to setup asynchronous systems, triggering tasks on the completion of other tasks, and how you report errors or recover from them.

What you'll learn

Asynchronous programming is the universal pattern to create efficient, safe, and high-throughput applications. Starting with Java SE 8, Java has its own API: CompletionStage, to create asynchronous data processing pipelines. In this course, Asynchronous Programming in Java SE 17, you will lean how to create asynchronous tasks based on the three models this API provides: Runnable, Consumers, and Functions. First, you will see how you can chain these tasks to trigger them on the outcome of other tasks. Then, you will explore what are the threads that are executing your tasks in the default configuration of the API, and how you can control them to balance your application, giving the right number of threads to the right number of tasks. Next, you will discover how you can have certain tasks to run in specific thread, for instance in the case that you need to update a graphical component, the API provides several mechanisms to deal with exceptions. Finally, you will learn how does the API processes exceptions, how you can log them and how you can recover from them if your application permits it. When you are finished with this course, you will be able to write your own asynchronous data processing pipelines, and will have hints on how you can set them up to get better performance.

Table of contents

Course Overview

About the author

Passionate about programming computers for over 20 years, Jose made his debut in assembler and C, C for SIMD parallel machines before adopting Java as an object-oriented language, indispensable to most major modern applications. He brings his expertise and capacity for analysis and synthesis to many projects, mainly in the lower layers, close to the data, but also on complex UI design, or in the browser. PhD in applied maths and computer science, assistant professor in Paris North University for... more

Ready to upskill? Get started