PRO

Effect Heartbeat Failure Detector

A phi-accrual failure detector instead of a fixed heartbeat timeout: the monitor stamps arrivals with its own Clock, learns each node's inter-arrival rhythm in a sliding window Ref, and reports a suspicion level (phi) that grows with silence relative to what is normal for that node. One congested heartbeat nudges phi and recovers on arrival, while sustained silence crosses the threshold and declares the node dead, so the cluster stops evicting healthy nodes over a single delayed packet. Nothing depends on the sick node self-reporting: a wedged process simply stops producing arrivals. Solves false-positive node kills and detection built on trusting the sender. Pinned to effect 4.0.0-beta.98.

Install
npx shadcn@latest add https://ui.aryank.space/r/effect-heartbeat-failure-detector.json

Installs from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.

Visualization
detector
node-7
Effect<void>
monitor
Effect<boolean>
if (silence > 40) evict(node) // congestion reads as death

The rule is dead after 40ms of silence. One congested heartbeat arrives 60ms late, the timeout fires, and a perfectly healthy node is evicted: its shards reshuffle onto the survivors, which is load the cluster did not need at the exact moment the network was already struggling.

Files

Dependencies