feat: implement sibling task spawning with automatic parent-ID inheritance#89
Merged
Conversation
…nce (#87) Add SiblingSpawnBuilder and DomainTaskContext::spawn_sibling_with() / spawn_siblings_with() so child tasks can spawn peer tasks under the same parent without manually threading the orchestrator's task ID. - SiblingSpawnBuilder routes through ModuleHandle for correct TTL/tag inheritance from the orchestrator (not the current task) - ModuleHandle::submit_batch for single-transaction batch spawns - DomainSubmitBuilder::sibling_of() for cross-domain sibling spawns - Wire spawn_children_with through submit_batch (perf fix) - Re-export SiblingSpawnBuilder from crate root - Integration tests covering inheritance, error cases, batch, and cross-domain paths
Merged
deepjoy
pushed a commit
that referenced
this pull request
Mar 25, 2026
## 🤖 New release * `taskmill`: 0.7.0 -> 0.7.1 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.7.1](v0.7.0...v0.7.1) - 2026-03-25 ### Added - implement sibling task spawning with automatic parent-ID inheritance ([#89](#89)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Contributor
Benchmark ComparisonClick to expand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DomainTaskContext::spawn_sibling_with()andspawn_siblings_with()so child tasks can spawn peer tasks under the same parent without manually threading the orchestrator's task IDDomainSubmitBuilder::sibling_of()for cross-domain sibling spawningModuleHandle::submit_batch()for single-transaction batch submissions, and wirespawn_children_withthrough it as a perf improvementTaskRecord::remaining_ttl()for correct TTL inheritance from parent recordsSiblingSpawnBuilderfrom crate rootCloses #87
Motivation
When child executors need to spawn peer tasks (e.g. BFS directory scans), they previously had to manually extract
parent_idfrom the context record and pass it tosubmit_with().parent(id). This was error-prone and verbose. The newspawn_sibling_with()API mirrors the existingspawn_child_with()ergonomics and returnsStoreError::InvalidStateif called from a root task, preventing silent creation of unparented tasks.Changes
src/registry/domain_context.rsSiblingSpawnBuilder,spawn_sibling_with(),spawn_siblings_with()src/domain.rsDomainSubmitBuilder::sibling_of()for cross-domain siblingssrc/module.rsModuleHandle::submit_batch()for single-transaction batch pathsrc/registry/context.rsspawn_children_withthroughsubmit_batchsrc/task/mod.rsTaskRecord::remaining_ttl()helpersrc/task/submit_builder.rsSubmitBuilder::resolve_only()(crate-internal)src/lib.rsSiblingSpawnBuilder, update module docsdocs/quick-start.mdexamples/test_sibling.rstests/integration/sibling_spawn.rs