What problem does it solve?
Golem agents have no built-in cron scheduler, so developers need a durable pattern to run periodic work like polling, cleanup, and heartbeats that survives agent crashes and restarts.
Core Features & Use Cases
- Self-Scheduling Pattern: The agent calls its generated client's
schedule_ method on itself at the end of each invocation, creating a durable recurring loop.
- Exponential Backoff: Increase delays on repeated failures and reset on success, with a configurable maximum interval cap.
- Cancellation Support: Stop loops via
schedule_cancelable_ variants returning a CancellationToken, a simple state flag, or the golem agent invocation cancel CLI command.
- Use Case: Build an agent that polls an external API every 60 seconds for new work items, processes them, and reschedules itself — recovering automatically after a crash because the pending invocation is durable.
Quick Start
Ask the AI to implement a recurring polling task in a Rust Golem agent that reschedules itself every 60 seconds using self-scheduling.