pub struct ProcessLease {
pub schema_version: u32,
pub process_id: ProcessId,
pub owner_id: String,
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_id, 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.
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: ProcessId§owner_id: String§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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProcessLease
impl Debug for ProcessLease
Source§impl<'de> Deserialize<'de> for ProcessLease
impl<'de> Deserialize<'de> for ProcessLease
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProcessLease
impl RefUnwindSafe for ProcessLease
impl Send for ProcessLease
impl Sync for ProcessLease
impl Unpin for ProcessLease
impl UnsafeUnpin for ProcessLease
impl UnwindSafe for ProcessLease
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more