pub struct MemoryLeaseStore { /* private fields */ }Expand description
In-process lease coordination, correct for a single service instance.
Workers within the process still gate children on parents and checkpoint, but nothing
survives a restart. Multiple instances need a shared store such as the DynamoDB one.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryLeaseStore
impl Debug for MemoryLeaseStore
Source§impl Default for MemoryLeaseStore
impl Default for MemoryLeaseStore
Source§fn default() -> MemoryLeaseStore
fn default() -> MemoryLeaseStore
Returns the “default value” for a type. Read more
Source§impl LeaseStore for MemoryLeaseStore
impl LeaseStore for MemoryLeaseStore
Source§fn acquire<'a>(
&'a self,
shard: &'a str,
owner: &'a str,
ttl: Duration,
) -> BoxFuture<'a, Result<bool, LeaseError>>
fn acquire<'a>( &'a self, shard: &'a str, owner: &'a str, ttl: Duration, ) -> BoxFuture<'a, Result<bool, LeaseError>>
Attempts to take the shard’s lease for
owner, valid for ttl. Returns false when
another live owner holds it.Source§fn renew<'a>(
&'a self,
shard: &'a str,
owner: &'a str,
ttl: Duration,
) -> BoxFuture<'a, Result<bool, LeaseError>>
fn renew<'a>( &'a self, shard: &'a str, owner: &'a str, ttl: Duration, ) -> BoxFuture<'a, Result<bool, LeaseError>>
Heartbeats the lease. Returns
false when the lease is no longer held (fenced).Source§fn checkpoint<'a>(
&'a self,
shard: &'a str,
owner: &'a str,
sequence: &'a str,
) -> BoxFuture<'a, Result<bool, LeaseError>>
fn checkpoint<'a>( &'a self, shard: &'a str, owner: &'a str, sequence: &'a str, ) -> BoxFuture<'a, Result<bool, LeaseError>>
Records
sequence as the shard’s checkpoint, conditional on owner holding the
lease. Returns false when fenced.Source§fn read<'a>(
&'a self,
shard: &'a str,
) -> BoxFuture<'a, Result<LeaseState, LeaseError>>
fn read<'a>( &'a self, shard: &'a str, ) -> BoxFuture<'a, Result<LeaseState, LeaseError>>
Reads the shard’s persisted state (regardless of ownership).
Auto Trait Implementations§
impl !Freeze for MemoryLeaseStore
impl RefUnwindSafe for MemoryLeaseStore
impl Send for MemoryLeaseStore
impl Sync for MemoryLeaseStore
impl Unpin for MemoryLeaseStore
impl UnsafeUnpin for MemoryLeaseStore
impl UnwindSafe for MemoryLeaseStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.