Observers: The Watchful Gnomes of the Village
happihacking.com·3d
🔐Capability Systems
Preview
Report Post

Some gnomes in the village don’t build bridges, bake bread, or carry mail. They stand on a hill, hold a lantern, and keep an eye on everyone else. When something goes wrong, they react. They don’t fix the problem themselves—they simply make sure the right thing happens next.

These are Observers. Their job is to keep the system healthy.

Observers come in two useful forms: Sentinels and Supervisors.


Sentinels

A Sentinel watches a process or a condition and acts when reality drifts away from expectations. Timeouts, deadlines, stalled workers, mailbox growth, missing responses—these are all things a Sentinel can detect.

Minimal example

handle_info(check, #state{pid = Pid, threshold = N} = S) ->
case process_info(Pid, message_queue_len) of
{message_qu...

Similar Posts

Loading similar posts...