/** * Process exit codes used to signal intent to the supervisor (systemd/launchd). * * The setup-worker.sh service unit is configured so that: * - STOP (0) → supervisor leaves the process down (clean, intentional stop) * - RESTART (75) → supervisor relaunches the process (EX_TEMPFAIL) * * This lets a remote operator distinguish "shut this worker down" from "bounce * this worker" without SSH access, and lets an OTA self-update relaunch onto * freshly-installed code. 75 is BSD sysexits' EX_TEMPFAIL — a conventional * "transient, try again" code that maps cleanly to systemd RestartForceExitStatus. */ export declare const EXIT_STOP = 0; export declare const EXIT_RESTART = 75; /** * Cross-platform liveness watchdog. * * systemd has WatchdogSec and launchd has nothing equivalent, so instead of * relying on either we run our own timer inside the process. The heartbeat loop * calls `pet()` on every successful tick; if more than `timeoutMs` elapses * without a pet — meaning the event loop is wedged, Redis is silently * black-holed, or the heartbeat is stuck — the watchdog force-exits with * EXIT_RESTART so the supervisor relaunches a healthy process. * * Because it's a plain timer driven by the app's own progress, it behaves * identically under systemd, launchd, or a bare `node` invocation. */ export declare class Watchdog { private readonly timeoutMs; private readonly onTrip; private lastPet; private timer; private tripped; constructor(timeoutMs: number, onTrip: () => void); /** Record that the worker made forward progress. */ pet(): void; start(): void; stop(): void; } //# sourceMappingURL=lifecycle.d.ts.map