pub struct RedisLockProviderBuilder { /* private fields */ }Expand description
Builder for Redis lock provider configuration.
Implementations§
Source§impl RedisLockProviderBuilder
impl RedisLockProviderBuilder
Sourcepub fn url(self, url: impl Into<String>) -> Self
pub fn url(self, url: impl Into<String>) -> Self
Adds a Redis server URL.
For RedLock, add multiple URLs (ideally 3 or 5).
Sourcepub fn client(self, client: RedisClient) -> Self
pub fn client(self, client: RedisClient) -> Self
Uses an existing Redis client.
Sourcepub fn extension_cadence(self, cadence: Duration) -> Self
pub fn extension_cadence(self, cadence: Duration) -> Self
Sets the lock extension cadence.
Sourcepub fn min_validity(self, validity: Duration) -> Self
pub fn min_validity(self, validity: Duration) -> Self
Sets the minimum validity time.
After acquiring, at least this much time must remain on the lock for the acquisition to be considered successful.
Sourcepub async fn build(self) -> LockResult<RedisLockProvider>
pub async fn build(self) -> LockResult<RedisLockProvider>
Builds the provider.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RedisLockProviderBuilder
impl !RefUnwindSafe for RedisLockProviderBuilder
impl Send for RedisLockProviderBuilder
impl Sync for RedisLockProviderBuilder
impl Unpin for RedisLockProviderBuilder
impl !UnwindSafe for RedisLockProviderBuilder
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 more