pub struct LockManager { /* private fields */ }Expand description
Lock manager for coordinating distributed locks
Implementations§
Source§impl LockManager
impl LockManager
Sourcepub fn new(backend: Arc<dyn LockBackend>) -> Self
pub fn new(backend: Arc<dyn LockBackend>) -> Self
Create a new lock manager
Sourcepub async fn acquire_with_retry(
&self,
key: &str,
holder: &str,
ttl: Duration,
max_retries: u32,
retry_delay: Duration,
) -> StorageResult<Box<dyn StorageLockGuard>>
pub async fn acquire_with_retry( &self, key: &str, holder: &str, ttl: Duration, max_retries: u32, retry_delay: Duration, ) -> StorageResult<Box<dyn StorageLockGuard>>
Acquire a lock with retry logic
Sourcepub async fn wait_for_lock(
&self,
key: &str,
holder: &str,
ttl: Duration,
timeout: Duration,
) -> StorageResult<Box<dyn StorageLockGuard>>
pub async fn wait_for_lock( &self, key: &str, holder: &str, ttl: Duration, timeout: Duration, ) -> StorageResult<Box<dyn StorageLockGuard>>
Wait for a lock to become available
Auto Trait Implementations§
impl !RefUnwindSafe for LockManager
impl !UnwindSafe for LockManager
impl Freeze for LockManager
impl Send for LockManager
impl Sync for LockManager
impl Unpin for LockManager
impl UnsafeUnpin for LockManager
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more