Jump to a problem, path or page
Jump to a problem, path or page
01 · Develop the design
Maintain a bounded submission queue and active child set under one event loop. A first failure requests cancellation and skips unstarted children, while join closes submissions and waits for all started children to settle before returning collected outcomes.
Stage 1
Model lifecycle separately
Track OPEN, CLOSING and SETTLED, plus a cancellation flag. join closes submissions but normally continues draining already-queued work.
Stage 2
Own every rejection
Install handlers as soon as a child starts, including synchronous factory throws. Store outcomes instead of leaving rejected promises unobserved.
Stage 3
Do not force-detach silently
An uncooperative child can keep join pending. A diagnostic timeout may report that fact but cannot truthfully call the child terminated.
02 · Work through the method
03 · Justify the choices
What does aborting a signal guarantee?
Only a cancellation request; children must cooperate
An arbitrary asynchronous operation can ignore cancellation and still complete or fail later.
When may join settle?
After submission closes and every started child settles
Returning early leaves child failures and resource ownership outside the group’s scope.
How should queued tasks behave after a child fails?
Mark unstarted tasks skipped and request cancellation of running tasks
The group should resolve every task handle explicitly without launching new work after failure.
04 · Plan the evidence