JavaThe Structured Concurrency API in JDK 26: Scoped and Joiners
Loom already delivered virtual threads and scoped values. It still needs to deliver one last element: the Structured Concurrency API, a preview feature of JDK 26. As of now, launching requets in parallel can be done using the ExecutorService pattern, or callback-based asynchronous programming. The Structured Concurrency API gives you new patterns of code, based on virtual threads, to launch this request in parallel, following the principle of structured imperative programming. The code you write is more readable, with less places for bugs to hide. It also gives you meaningful stack traces for better debugability and profiling. This presentation takes you through these patterns, showing you how the StructuredTaskScope objects are working, and how you can configure them. You will see how you can build your own asynchronous strategies for the handling of the results your tasks give you using Joiners, and how you can build them to exactly fit the specific needs of your application.
comments.speakerNotEnabledComments