What problem does it solve?
When one Golem agent needs to call another agent, awaiting the result can cause deadlocks (in cyclic calls) or block the caller unnecessarily. This Skill shows how to enqueue agent method invocations in MoonBit that return immediately while the target agent processes the work asynchronously.
Core Features & Use Cases
- Trigger Methods: Every auto-generated
AgentClient method has a trigger_ variant that enqueues the call and returns immediately.
- Deadlock Breaking: Use
trigger_ for callbacks between agents (A calls B, B notifies A) to avoid RPC cycles.
- Fan-Out and Background Work: Trigger work on many agents in parallel or enqueue background tasks without blocking the current agent.
- Use Case: An agent processing a batch job needs to notify its caller when done. Instead of awaiting the callback (which would deadlock), it uses
client.trigger_on_work_done(result) to fire-and-forget the notification.
Quick Start
Show me how to trigger a fire-and-forget invocation on another Golem agent from my MoonBit agent code using the trigger_ client method.