golem-fire-and-forget-rust

Enqueue asynchronous agent method invocations in Rust Golem projects without awaiting results.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-fire-and-forget-rust
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-fire-and-forget-rust
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/rust/golem-fire-and-forget-rust
Command: npx skills add https://github.com/golemcloud/golem --skill golem-fire-and-forget-rust

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When building distributed agent systems in Golem with Rust, awaiting every agent-to-agent call can cause deadlocks (cyclic RPC calls) or unnecessary blocking. This Skill shows how to trigger agent invocations that return immediately while the target agent processes the work asynchronously.

Core Features & Use Cases

  • Trigger Variants: Every generated <AgentName>Client method has a trigger_ counterpart that enqueues the call and returns immediately.
  • Deadlock Prevention: Break RPC cycles when agent A calls agent B and B needs to call back into A.
  • Fan-Out and Background Work: Trigger work on many agents in parallel or enqueue background processing without blocking the caller.
  • CLI Equivalent: Use golem agent invoke --enqueue to fire-and-forget from the command line.
  • Use Case: A data pipeline agent fans out batch processing jobs to dozens of worker agents using trigger_process_batch, then continues its own work without waiting for each worker to finish.

Quick Start

Show me how to make a fire-and-forget call to another Golem agent in Rust using the trigger_ method variant.

Frequently Asked Questions about golem-fire-and-forget-rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a fire-and-forget agent call in Golem Rust?

Use the trigger_ variant of any method on the generated agent client, such as counter.trigger_increment(). The call enqueues the invocation on the target agent and returns immediately without waiting for the result.

How do I avoid deadlocks between Golem agents calling each other?

Use a trigger_ fire-and-forget call for the callback direction. If agent A awaits a call to agent B, agent B must notify A via a trigger_ method instead of an awaited call, otherwise the cyclic RPC deadlocks.

Can I enqueue a Golem agent invocation from the command line?

Yes, use golem agent invoke with the --enqueue flag, for example golem agent invoke --enqueue 'counter-agent("my-counter")' 'my:comp/counter-agent.{increment}'. This enqueues the invocation without waiting for a result.

When should I use trigger_ instead of an awaited agent call?

Use trigger_ for background work, fan-out to many agents, event notifications, and breaking RPC cycles. Use awaited calls when you need the return value or must confirm the invocation completed before continuing.

Does a fire-and-forget call return the agent method result?

No, trigger_ calls return immediately without a result. The target agent processes the invocation asynchronously, so if you need the output you must use the standard awaited client method instead.