golem-schedule-future-call-rust

Schedule future agent method invocations in Rust Golem projects using Datetime timestamps.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers building agents on Golem often need to defer work—such as reminders, retries, or periodic tasks—without blocking the current invocation. This Skill shows how to enqueue a method call on a target agent to run at a specific future time using the generated client in Rust.

Core Features & Use Cases

  • Scheduled Invocations: Every generated <AgentName>Client method has a schedule_ variant that accepts a Datetime as the first argument and returns immediately.
  • Datetime Handling: Uses golem_rust::wasip2::clocks::wall_clock::Datetime with seconds and nanoseconds since the Unix epoch for precise scheduling.
  • Use Case: Build a counter agent that schedules its own increment 60 seconds in the future, or a report agent that generates a daily summary at midnight by passing arguments along with the scheduled time.

Quick Start

Ask the AI to schedule a Golem agent method call in Rust to run at a specific future time using the schedule_ client variant and a Datetime timestamp.

Frequently Asked Questions about golem-schedule-future-call-rust

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

FAQPage Schema
How do I schedule a future agent invocation in Golem with Rust?

Use the schedule_ variant of any method on the generated agent client, passing a Datetime as the first argument. For example, counter.schedule_increment(Datetime { seconds: now_secs + 60, nanoseconds: 0 }) runs the increment 60 seconds later.

What is the Datetime type in golem_rust?

Datetime comes from golem_rust::wasip2::clocks::wall_clock and represents a point in time as seconds plus nanoseconds since the Unix epoch. You construct it with a seconds field and a nanoseconds field for sub-second precision.

Does a scheduled Golem invocation block the calling agent?

No, scheduled invocations return immediately after enqueueing the call. The target agent processes the method when the scheduled time arrives, so the caller is never blocked waiting for execution.

Can I pass arguments to a scheduled agent method in Golem?

Yes, scheduled variants accept the same arguments as the original method along with the Datetime. For example, reporter.schedule_generate_report("summary".to_string(), Datetime { ... }) passes both the argument and the scheduled time.

What are common use cases for scheduled invocations in Golem?

Common use cases include periodic tasks that reschedule themselves at the end of each run, delayed processing after a cooling-off period, timed reminders and notifications, and retrying failed operations with backoff delays.