💻JDK 28 Finalizes StructuredTaskScope API with JEP 543
Structured concurrency goes final in JDK 28
TL;DR
JEP 543 integrates StructuredTaskScope API into JDK 28, finalizing it for structured concurrency. Teams on JDK 27 can migrate with a build change, while those on JDK 26 need more adjustments. Scheduled for March 2027.
JEP 543 has been integrated into JDK 28, finalizing the StructuredTaskScope API for structured concurrency. This API, which debuted as an incubator in JDK 19 and 20, treats related subtasks as a single unit of work. For teams already on JDK 27, migration is a simple build change, while those on JDK 26 need to replace FailedException with ExecutionException and remove StructuredTaskScope.TimeoutException. The finalized API preserves the exact shape established in JDK 27 and is scheduled for general availability in March 2027. The velo/structured-concurrency project already backports the API to JDK 25 and provides migration recipes.

Key Points
JEP 543 integrates StructuredTaskScope API into JDK 28, finalizing it for structured concurrency.
Teams on JDK 27 can migrate with a build change, no code changes needed.
Teams on JDK 26 need to replace FailedException with ExecutionException and remove StructuredTaskScope.TimeoutException.
The API centers on StructuredTaskScope<T, R, R_X>, a sealed interface opened through static factory methods.
velo/structured-concurrency project backports the API to JDK 25 and ships migration recipes.
Why It Matters
If you're managing complex thread operations in Java, the StructuredTaskScope API in JDK 28 simplifies handling related subtasks as a single unit. Teams on JDK 27 can migrate easily, but those on JDK 26 need to replace FailedException with ExecutionException and remove StructuredTaskScope.TimeoutException. The API's strict structure ensures clean and predictable concurrency patterns, enhancing reliability and maintainability in multi-threaded applications.
Comments
Be the first to comment
Enjoyed this article?
Get it daily. 7am. Free. Reads in 5 minutes.
Join 3,567 builders reading daily.