golemcloud/golem/golem-parallel-workers-rust
Claude Code and agent skill by golemcloud/golem
- community
Checking that the SKILL.md file is still in the repository.
Fan out work to multiple parallel agents and collect results in a Rust Golem project. Use when the user asks about parallel execution, fan-out/fan-in, spawning child agents for parallel work, forking, or aggregating results from multiple agents.
Install
npx vskill@latest install golemcloud/golem/golem-parallel-workers-rustSKILL.md
The same SKILL.md was published earlier as golemcloud/golem/golem-parallel-workers-rust.
Parallel Workers — Fan-Out / Fan-In (Rust)
Overview
Golem agents process invocations sequentially. Within one invocation, async I/O and stream tasks can overlap cooperatively; this is not CPU-thread parallelism. Distribute work across multiple agent instances for independent invocation execution. This skill covers two approaches:
- Child agents via `AgentClient::upsert(id)` — spawn separate agent instances, dispatch work, and collect results
- `fork()` — clone the current agent at the current execution point for lightweight parallel execution
Use the futures_concurrency crate for structured concurrency when aggregating results from multiple async operations.
Prerequisites
Add futures-concurrency to your component's Cargo.toml:
Approach 1: Child Agent Fan-Out
Spawn child agents, dispatch work concurrently, and collect results with Join or TryJoin.
Basic Pattern with Join
Fire-and-Forget with Promise Collection
For long-running work, trigger children with fire-and-forget and collect results via Golem promises:
Error Handling with TryJoin
Use TryJoin to short-circuit on the first failure, or Join and handle errors manually for partial-failure tolerance:
These recipes use a separate fallible worker contract (implement it in the worker):
Only the returned domain Result is isolated here. Generated RPC clients panic on invocation failure; Join does not turn those panics into domain errors or isolate them from the coordinator.
Short-circuit on first error (TryJoin)
Collect partial results (Join + per-future error handling)
Approach 2: fork()
fork() clones the current agent at the current execution point, creating a new agent instance without a key, with the same state but a new agent ID (ForkDetails::forked_agent_id). Only a durable agent can fork, and the forked agent is durable too. Use Golem promises to synchronize between the original and forked agents.
Basic Fork Pattern
Multi-Fork Fan-Out
Fork multiple times for N-way parallelism, then join all promises concurrently:
When to Use Which Approach
| Criteria | Child Agents | fork() | |
|---|---|---|---|
| Work is independent and stateless | ✅ Best fit | Works but overkill | |
| Need to share current state with workers | ❌ Must pass via args | ✅ Forked copy inherits state | |
| Workers need persistent identity | ✅ Each has own ID | ❌ Each forked agent gets a new agent ID and no key | |
| Number of parallel tasks is dynamic | ✅ Spawn as many as needed | ✅ Fork in a loop | |
| Need domain error collection | Return Result from the worker; RPC failures can still panic in the caller | Forked agent shares oplog lineage |
Key Points
- No CPU threads: Async tasks can interleave within an invocation; distribute CPU work across agent instances
- Durability: All RPC calls, promises, and fork operations are durably recorded — work survives crashes
- Deadlock avoidance: Never have two agents awaiting each other synchronously — use
trigger_to break cycles - Cleanup: Child agents persist after the coordinator finishes; delete them explicitly if they hold unwanted state
- `futures_concurrency`: Use
Vec<Future>.join().awaitto await all futures concurrently, or.try_join().awaitto short-circuit on the first error - Always async: Prefer
await_promise/await_promise_jsonover blocking variants for all concurrent patterns
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggolem-skills/skills/rust/golem-parallel-workers-rust/SKILL.md
Popularity
- Repository stars
- 1,506
- Repository forks
- 213
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/golemcloud/golem/golem-parallel-workers-rust)