Structured concurrency (preview status)
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
understand the idea and its status.
Planned topics
- Structured concurrency: subtasks live inside a scope, and the scope waits for them, so lifetimes are clear.
- A failure can cancel sibling tasks; no leaked threads.
- API:
StructuredTaskScopewith fork and join; its status has been preview and the API has changed (verify version before recording). - Using preview APIs needs
--enable-preview; avoid in production unless the team accepts the risk. - Compare with
CompletableFuturefan-out from MID-006.
Draft outline details
Demonstration
// conceptual: fork product, stock; join; failure cancels the otherCheck your understanding
Why is a preview API risky for production?
Show answer
It may change or be removed between releases.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.