Skip to main content

acquire

Function acquire 

Source
pub fn acquire(
    store: &Arc<LeaseStore>,
    uid: &str,
    agent: &str,
    boot_id: &Arc<str>,
    block_id: &str,
    session_id_hint: Option<&str>,
    on_lost: impl Fn(String) + Send + Sync + 'static,
) -> Result<HeldAgentLease, String>
Expand description

Claim uid for this process’s block_id, and keep it renewed until the returned handle is dropped. on_lost runs (once, off the caller’s thread) if the lease is found to belong to someone else — the holder must then stop driving the agent.

Err is the user-facing refusal. The host tier fails closed (spec D2): an I/O error claiming the lease refuses rather than running unguarded, after one short retry for a transient sharing violation.