Grain timers and reminders
Orleans schedules periodic grain work through two mechanisms with distinct ownership and durability guarantees:
| Mechanism | Owner | Schedule storage | Activation behavior | Typical cadence |
|---|---|---|---|---|
| Grain timer | One grain activation | Activation memory | Executes on the current activation and ends with it | Frequent work while an activation is active |
| Reminder | One logical grain | Configured reminder provider | Activates the grain when a tick is delivered and resumes after cluster recovery | Work measured in minutes, hours, or days |
Choose a grain timer when the work belongs to the current activation. Choose a reminder when the schedule belongs to the grain identity and must survive activation and cluster lifecycle changes.
Grain timers
Section titled “Grain timers”Grain timers execute callbacks as grain turns on one activation. The runtime schedules the next tick after the current callback completes, so a timer callback never overlaps itself.
See Grain timers for registration, callback scheduling, interleaving, activation lifetime, cancellation, and troubleshooting.
The timer behavior reference describes the guarantees controlled by GrainTimerCreationOptions.
Reminders
Section titled “Reminders”Reminders persist a schedule for a logical grain. Reminder delivery follows normal grain request scheduling and activates the grain when needed. The provider preserves the schedule while each tick is generated and delivered by the runtime.
See Reminders for registration, durable scheduling, timing constraints, provider configuration, missed-tick reconciliation, and troubleshooting.
The reminder delivery reference explains durable definitions, volatile tick delivery, reactivation, and recovery.
The reminder timing constraints define valid due times and periods.
Configure reminder storage
Section titled “Configure reminder storage”Every silo configures one reminder provider. See Configure reminder storage for production providers, development configuration, and provider-specific guidance.
POCO grains
Section titled “POCO grains”Grains implementing IGrainBase directly use the same timer and reminder extension APIs. The dedicated grain timer and reminder pages describe the lower-level registries available through dependency injection.
