pub struct RedisTaskStore { /* private fields */ }Expand description
Redis or Valkey durable-task attribution with atomic, once-only claims.
Implementations§
Source§impl RedisTaskStore
impl RedisTaskStore
Sourcepub async fn connect(
connection_url: &str,
key_prefix: impl Into<String>,
ttl: Duration,
) -> Result<Self, StoreConfigError>
pub async fn connect( connection_url: &str, key_prefix: impl Into<String>, ttl: Duration, ) -> Result<Self, StoreConfigError>
Connect with a reconnecting, multiplexed async connection manager.
ttl must outlive the longest task the upstream server can run, not
the client’s polling interval. A task that outlives it bills zero. See
the crate-level notes.
§Errors
Returns a sanitized error for invalid configuration or connection failure. Connection URLs are never retained for debug output.
Sourcepub async fn connect_with_timeout(
connection_url: &str,
key_prefix: impl Into<String>,
ttl: Duration,
operation_timeout: Duration,
) -> Result<Self, StoreConfigError>
pub async fn connect_with_timeout( connection_url: &str, key_prefix: impl Into<String>, ttl: Duration, operation_timeout: Duration, ) -> Result<Self, StoreConfigError>
Connect with an explicit bound for connection and command operations.
§Errors
Returns a sanitized error for invalid configuration or connection failure. Connection URLs are never retained for debug output.
Trait Implementations§
Source§impl Clone for RedisTaskStore
impl Clone for RedisTaskStore
Source§impl Debug for RedisTaskStore
impl Debug for RedisTaskStore
Source§impl TaskAttributionStore for RedisTaskStore
impl TaskAttributionStore for RedisTaskStore
Source§fn insert<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
attribution: TaskAttribution,
) -> TaskStoreFuture<'a, ()>
fn insert<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, attribution: TaskAttribution, ) -> TaskStoreFuture<'a, ()>
Associate a task with its resolved price and fixed origin category.
Source§fn get<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
) -> TaskStoreFuture<'a, Option<TaskAttribution>>
fn get<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, ) -> TaskStoreFuture<'a, Option<TaskAttribution>>
Resolve an association without consuming it.
Source§fn claim<'a>(
&'a self,
tenant_id: &'a str,
task_id: &'a str,
) -> TaskStoreFuture<'a, Option<TaskAttribution>>
fn claim<'a>( &'a self, tenant_id: &'a str, task_id: &'a str, ) -> TaskStoreFuture<'a, Option<TaskAttribution>>
Atomically consume and return an association. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RedisTaskStore
impl !UnwindSafe for RedisTaskStore
impl Freeze for RedisTaskStore
impl Send for RedisTaskStore
impl Sync for RedisTaskStore
impl Unpin for RedisTaskStore
impl UnsafeUnpin for RedisTaskStore
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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