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 → CloudWatch Events

How It Works

Created via Make(Bus) functor. Schedules are implemented using setInterval (for recurring rates) or setTimeout (for single-shot Single(...) schedules). When triggered, the timer publishes the schedule's payload as an event to the bus.

Schedule rates are converted to milliseconds:

  • Minutes(n)n * 60 * 1000
  • Hours(n)n * 60 * 60 * 1000
  • Days(n)n * 24 * 60 * 60 * 1000
  • Single(...) → fires immediately (setTimeout(fn, 0))

Operations

OperationDescription
createScheduleSets up a timer that publishes events to the bus topic
deleteScheduleClears the timer for a given schedule name

Test Utilities

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

Key Differences from AWS

AspectLocalAWS
SchedulingsetInterval / setTimeoutCloudWatch Events rules
Rate expressionsConverted to millisecondsCloudWatch rate/cron expressions
Payload deliveryBus event publishCloudWatch → Lambda → SQS