Alpha Version: You are viewing the ALPHA documentation. This is an experimental version and may contain breaking changes.
Skip to main content

ScheduledPublisher — Local

Source: reventless-local/src/adapter/Scheduler/LocalScheduledPublisher.res

AWS equivalent: ScheduledPublisher → EventBridge Scheduler

How It Works​

Created via Make(Bus) functor. For each schedule it waits for the next firing that ScheduleTime.nextFiring names, publishes the payload as an event on the bus, and waits again. ScheduleTime is the same reading of a time that builds the AWS expression, so a schedule fires at the same times locally and on AWS:

  • Every(interval) — one interval after it is set, then every interval.
  • Calendar(...) — at the wall-clock time in its zone; a day whose time falls in the hour daylight saving skips does not fire.
  • Once(...) — once; an After is counted from the moment it is set, and a moment already past never fires.

A firing further away than a timer can wait is reached a day at a time.

Operations​

OperationDescription
createScheduleValidates the time and starts waiting; replaces a schedule of the same name
deleteScheduleStops the schedule of that name

Test Utilities​

FunctionDescription
reset()Clears all active timers — call in afterAll or afterEach

Key Differences from AWS​

AspectLocalAWS
SchedulingsetTimeout to each next firingEventBridge Scheduler schedules
Time expressionsScheduleTime.nextFiringScheduleTime.toAws: rate, cron or at
Payload deliveryBus event publishScheduler → SQS
Survives a restartNoYes