Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Background lifecycle tasks for the lock registry.

  • start_heartbeat_loop: spawns a tokio task that scans for stale locks every interval and emits lock: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 LockRegistryHandle instead of a bare Arc<LockRegistry>.