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

Heartbeat — Local

Source: reventless-local/src/adapter/Heartbeat/LocalHeartbeatRunner.res

AWS equivalent: Heartbeat → CloudWatch Events

How It Works

Uses setInterval to fire the heartbeat handler at the configured timeout interval (converted from minutes to milliseconds). The handler is obtained via an Effect Deferred — after the first tick, subsequent calls resolve immediately.

Active timer handles are tracked in a module-level dictionary for cleanup.

Operations

OperationDescription
makeCreates a setInterval timer that invokes the handler periodically

Test Utilities

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

Key Differences from AWS

AspectLocalAWS
SchedulingsetIntervalCloudWatch Events rule
Timer resolutionMillisecondsMinutes (CloudWatch minimum)
CleanupManual reset() callCloudWatch rule deletion