pub struct ProcessLease {
pub schema_version: u32,
pub process_id: String,
pub owner: LeaseOwnerIdentity,
pub lease_token: String,
pub fencing_token: u64,
pub claimed_at_epoch_ms: u64,
pub expires_at_epoch_ms: u64,
}Expand description
Durable lease over a non-terminal background process.
The lease pair (owner, lease_token) plus fencing_token are how lash guarantees that
one non-terminal process is re-executed by exactly one worker at a time —
even after a crash, even across two workers that both sweep the same
registry for recoverable work. The durable backend
(lash-sqlite-store) uses these to serialize concurrent claims on the same
process_id; future distributed durable backends use the same fields to
coordinate workers that don’t share a file system.
The owner is a full LeaseOwnerIdentity:
its persisted liveness metadata is what lets a sweeping worker prove a
busy holder is definitely dead and reclaim the lease before the TTL
through ProcessRegistry::reclaim_process_lease,
mirroring the session execution lane.
This is not single-process theatre. The owner / fencing-token / lease-token triple is the public contract that lets any backend detect and reject stale writers. Treat it as load-bearing, not defensive.
Fields§
§schema_version: u32§process_id: String§owner: LeaseOwnerIdentity§lease_token: String§fencing_token: u64§claimed_at_epoch_ms: u64§expires_at_epoch_ms: u64Trait Implementations§
Source§impl Clone for ProcessLease
impl Clone for ProcessLease
Source§fn clone(&self) -> ProcessLease
fn clone(&self) -> ProcessLease
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more