Crate vigil

source ·
Expand description

A crate to watch over code and ensure that it is still making progress. The idea is that the code under the vigil should indicate it is alive at regular intervals. If the code doesn’t keep up with its notifications, registered callbacks will be run which may make an attempt to produce diagnostics/kill stalled work/abort the process.

If the code under test knows it will not be reporting liveness for a longer than usual period, it can pre-declare this to the vigil by extending the check interval (the code should be careful to reset the interval once the long-standing operation is complete).

Structs

Represents a single vigil over the code. Should be notified every tick_interval, if enough intervals pass without a notification the callback will be fired (on a separate thread).