golem-schedule-future-call-scala

Schedule future agent method invocations in Scala Golem projects using scheduleAt and Datetime helpers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers building agents on Golem in Scala need a way to defer method calls to a later time without blocking the current execution, such as for reminders, retries, or delayed processing.

Core Features & Use Cases

  • Scheduled Invocation: Call .scheduleAt(when) on any remote proxy method to enqueue it for execution at a specific future time.
  • Datetime Helpers: Use golem.Datetime.afterSeconds(...) to express delays like 60 seconds or 1 hour from now.
  • Cancelable Scheduling: Use scheduleCancelableAt to obtain a CancellationToken that can cancel the pending invocation before it fires.
  • Use Case: Schedule a daily report agent to generate a summary one hour from now, or implement retry-with-backoff by scheduling a retry after a failure.

Quick Start

Ask the assistant to schedule a Scala Golem agent method call to run at a future time using scheduleAt and Datetime.afterSeconds.

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

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

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

Call .scheduleAt(when) on any method of the remote agent proxy, passing a golem.Datetime value such as Datetime.afterSeconds(60). The call returns immediately and the target agent executes the method when the scheduled time arrives.

How to cancel a scheduled agent call in Golem Scala?

Use the scheduleCancelableAt variant instead of scheduleAt, which returns a Future[CancellationToken]. Call .cancel() on the token before the scheduled time to prevent the invocation from firing.

Does scheduleAt support method arguments in Golem Scala agents?

Yes, pass the method parameters first followed by the when parameter, for example reporter.generateReport.scheduleAt("summary", when = Datetime.afterSeconds(3600)). The arguments are captured and delivered when the invocation fires.

What time helpers does golem.Datetime provide for scheduling?

The golem.Datetime type provides afterSeconds(n) to express a time n seconds from now, such as Datetime.afterSeconds(60) for one minute or Datetime.afterSeconds(3600) for one hour.

When should I use scheduled invocations in Golem agents?

Use scheduled invocations for periodic tasks by scheduling the next run at the end of each invocation, delayed processing after a cooling-off period, timed reminders, and retry-with-backoff after failures.