Skip to main content

lock_until

Function lock_until 

Source
pub fn lock_until(block_id: &str, until_ms: i64)
Expand description

Lease block_id against human input until until_ms (absolute unix ms).

Called before every agent write (PtyShellInput/PtyShellResize), which is what makes the lease self-renewing while an agent is actively working and self-releasing ~AGENT_LOCK_WINDOW_MS after it stops. A lease that is already in the past is not stored (and clears any existing one) — there is no such thing as a lease that is expired the moment it’s taken, and keeping it would only leave an entry for is_locked to prune later.