API reference@evolu/commonSchedule › fixed

function fixed(interval: Duration): Schedule<number>;

Defined in: packages/common/src/Schedule.ts:345

Fixed interval schedule aligned to time windows.

Recurs on a fixed interval, outputting the repetition count (0, 1, 2, ...). Unlike spaced, which waits a duration after each execution, fixed maintains a consistent cadence from when the schedule started.

If execution takes longer than the interval, the next execution happens immediately but subsequent runs still align to the original window boundaries. This prevents "pile-up" while maintaining predictable timing.

Example

// Health check every 5 seconds, aligned to windows
const healthCheck = take(10)(fixed("5s"));

// Cron-like behavior: run at consistent intervals
const cronLike = fixed("1m");