Scheduling

Scheduling

Demonstrates how to schedule tasks and execute code at specific times or intervals using Rivet Actors.

Features

  • Task scheduling: Schedule actor actions to run at specific times with schedule.at()
  • Delayed execution: Schedule tasks to run after a delay with schedule.after()
  • Persistent schedules: Scheduled tasks survive actor restarts
  • Action callbacks: Scheduled tasks invoke actor actions with custom payloads

Implementation

This example demonstrates time-based task scheduling in Rivet Actors:

  • Actor Definition (src/backend/registry.ts): Shows how to use schedule.at() and schedule.after() to schedule future actions with persistent state

Resources

Read more about scheduling, actions, and state.