Skip to content
Ameen Abozaid
Planned lessonMID-007-L05

Structured concurrency (preview status)

  • Lesson 5 of 6
  • Mid-level
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: StructuredTaskScope with 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 CompletableFuture fan-out from MID-006.
Draft outline details

Demonstration

java
// conceptual: fork product, stock; join; failure cancels the other

Check 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.