Scope-Owned Work
child-scope work convergence
function* publishArticle() {
const result = yield* branch(function* commitArticle() {
yield* spawn(function* updateSearchIndex() {
yield* sleep(1000);
});
return "published";
});
return result;
} publishArticle enters branch to run commitArticle, then returns its result.
branch creates a child scope that owns work spawned inside the boundary.
commitArticle produces published before updateSearchIndex finishes.
branch waits for scope-owned work before returning.