Virtual Threads, Structured Concurrency and Scoped Values: Putting it all together
summary
Builds a Spring Boot web app (uses Spring Boot 3.5 on JDK 25), flips a flag to enable virtual threads so each request runs on a virtual thread, and replaces CompletableFutures with StructuredTaskScope: fork subtasks for accounts, loans and two credit‑score calls, join with a StructuredTaskScope with ANY_SUCCESS joiner so one credit score winning cancels the other, showing short‑circuiting and cancellation propagation. Adds a scoped value for a UUID request ID inherited by child tasks; the demo runs end‑to‑end and returns offers.
AI-written summary · about
chapters (9)
- 0:00Project Loom introduction
- 4:05Virtual threads scalability
- 7:21Spring Boot virtual threads
- 11:14Structured concurrency benefits
- 12:59Implementing structured concurrency
- 27:49Structured vs CompletableFuture
- 29:59Scoped values vs thread locals
- 36:01Scoped values in banking
- 41:22Summary
related talks
48mVirtual Threads, Structured Concurrency and Scoped Values: Putting it all together
47mVirtual Threads, Structured Concurrency & 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
44mGet The Most Out of Virtual Threads in Java 25: A Deep Dive
