Expand description
Background lifecycle tasks for the lock registry.
start_heartbeat_loop: spawns a tokio task that scans for stale locks everyintervaland emitslock:released { reason: ttl }for each.
§OCP contract
The heartbeat loop is generic over EventEmitter, so any emitter (real
Tauri AppHandle or MockChannel) can be substituted without changing
this module.
Functions§
- current_
unix_ secs - Return current Unix timestamp in seconds.
- start_
heartbeat_ loop - Spawn a tokio task that periodically scans for stale locks and releases them.
- start_
heartbeat_ loop_ handle - Convenience wrapper that accepts a
LockRegistryHandleinstead of a bareArc<LockRegistry>.