pub struct RuntimeLeaseConfig {
pub lease_id: String,
pub owner_id: String,
pub ttl: Duration,
pub renew_interval: Duration,
pub standby_retry_interval: Duration,
}Expand description
Runtime lease settings for one singleton worker group.
Fields§
§lease_id: StringStable lease key shared by all service instances.
owner_id: StringProcess-unique identifier for the current runtime owner.
ttl: DurationTime after which another owner may take over if renewals stop.
renew_interval: DurationInterval used by the current owner to renew the lease.
standby_retry_interval: DurationInterval used by standby instances before attempting acquisition again.
Implementations§
Source§impl RuntimeLeaseConfig
impl RuntimeLeaseConfig
Sourcepub fn new(lease_id: impl Into<String>, owner_id: impl Into<String>) -> Self
pub fn new(lease_id: impl Into<String>, owner_id: impl Into<String>) -> Self
Creates runtime lease settings with conservative default intervals.
Sourcepub const fn renew_interval(self, renew_interval: Duration) -> Self
pub const fn renew_interval(self, renew_interval: Duration) -> Self
Sets the owner renewal interval.
Sourcepub const fn standby_retry_interval(
self,
standby_retry_interval: Duration,
) -> Self
pub const fn standby_retry_interval( self, standby_retry_interval: Duration, ) -> Self
Sets the standby acquisition retry interval.
Trait Implementations§
Source§impl Clone for RuntimeLeaseConfig
impl Clone for RuntimeLeaseConfig
Source§fn clone(&self) -> RuntimeLeaseConfig
fn clone(&self) -> RuntimeLeaseConfig
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 RuntimeLeaseConfig
impl Debug for RuntimeLeaseConfig
Source§impl PartialEq for RuntimeLeaseConfig
impl PartialEq for RuntimeLeaseConfig
Source§fn eq(&self, other: &RuntimeLeaseConfig) -> bool
fn eq(&self, other: &RuntimeLeaseConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for RuntimeLeaseConfig
impl StructuralPartialEq for RuntimeLeaseConfig
Auto Trait Implementations§
impl Freeze for RuntimeLeaseConfig
impl RefUnwindSafe for RuntimeLeaseConfig
impl Send for RuntimeLeaseConfig
impl Sync for RuntimeLeaseConfig
impl Unpin for RuntimeLeaseConfig
impl UnsafeUnpin for RuntimeLeaseConfig
impl UnwindSafe for RuntimeLeaseConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.