Virtual Threads, Structured Concurrency and Scoped Values: Putting it all together
summary
Builds a Spring Boot 3.4 app on JDK25 EA (Project Loom) that replaces thread‑pool code with Virtual Threads, creates a loan‑application flow using StructuredTaskScope.open to fork/join REST calls (accounts, loans, two credit‑score services) and uses ScopedValue.newInstance as a request context instead of passing customer objects. Virtual threads are created per task, short‑circuiting cancels sibling tasks (demo shows both credit‑score calls sometimes return simultaneously), errors propagate to produce 500s, and the example successfully returns calculated offers.
AI-written summary · about
chapters (13)
- 0:00Project Loom features intro
- 1:27Project Loom goals
- 2:30Platform vs virtual threads
- 5:17Virtual threads in Spring Boot demo
- 8:29Structured concurrency intro
- 13:06Structured concurrency API
- 15:35Loan app with structured concurrency demo
- 29:19Structured concurrency vs CompletableFuture
- 32:26Thread locals limitations
- 35:34Scoped values intro
- 38:03Scoped values in Spring Boot demo
- 43:20Structured concurrency errors
- 46:54Summary and resources
related talks
47mVirtual Threads, Structured Concurrency & Scoped Values: Putting it All Together
42mVirtual Threads, Structured Concurrency and Scoped Values: Putting it all together
01h 03mBeyond Virtual Threads: Structured Concurrency
44mStructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads
44mStructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads
49mStructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads
38mStructuredTaskScope And ScopedValue - Get The Most Out of Virtual Threads
50mGet The Most Out of Virtual Threads in Java 25 -A Deep Dive into the Latest Achievements of Virtual
