A good heartbeat timer
npm install jasonkuhrt-heartbeat
var tcp = ;var heartbeat = ;tcp;
> npm start ... ... (some time passes, your app does stuff, then maybe...) ... Socket timed out, destroying socket.
Heartbeat → .setHeartbeat
Heartbeat h; Int i; :: ( -> ), i -> h
Returns a heartbeat instance. A heartbeat instance is a function. Invoke it to keep the heartbeat going. The identifier is typically
thump (see guide).
onFlatlineis invoked when/if
thumpis not invoked during an interval.
intervalMssets the time between thump checks.
Heartbeat a :: a -> undefined
Destroy a heartbeat instance. Analagous to
clearHeartbeat if you need to abort a heartbeat before