Skip to main content

start_heartbeat_loop

Function start_heartbeat_loop 

Source
pub fn start_heartbeat_loop<E>(
    registry: Arc<LockRegistry>,
    interval: Duration,
    channel: Arc<E>,
)
where E: EventEmitter + Send + Sync + 'static,
Expand description

Spawn a tokio task that periodically scans for stale locks and releases them.

The task runs every interval until the process exits (there is no cancellation token in v1; the task exits when the runtime shuts down).

For each stale lock release_stale is called and a lock:released event with reason: Ttl is emitted via channel.