pub struct RedisList { /* private fields */ }Expand description
Describes one list subscription against crate::RedisBroker.
§Examples
use std::time::Duration;
use ruststream_fred::RedisList;
let simple = RedisList::new("jobs");
let reliable = RedisList::new("jobs").reliable().block(Duration::from_secs(2));Implementations§
Source§impl RedisList
impl RedisList
Sourcepub fn new(key: impl Into<String>) -> Self
pub fn new(key: impl Into<String>) -> Self
A simple (at-most-once) BRPOP work-queue consumer on key.
Sourcepub const fn reliable(self) -> Self
pub const fn reliable(self) -> Self
Switches to reliable (at-least-once) mode: entries move to a processing list and are removed
on ack.
Sourcepub fn processing(self, key: impl Into<String>) -> Self
pub fn processing(self, key: impl Into<String>) -> Self
Sets the processing-list key used in reliable mode. Defaults to <key>.processing.
Sourcepub const fn block(self, block: Duration) -> Self
pub const fn block(self, block: Duration) -> Self
How long one blocking pop waits before looping. Defaults to 5 seconds.
Trait Implementations§
Source§impl SubscriptionSource<RedisBroker> for RedisList
impl SubscriptionSource<RedisBroker> for RedisList
Source§type Subscriber = RedisListSubscriber
type Subscriber = RedisListSubscriber
The subscriber type this source opens.
Source§async fn subscribe(
self,
broker: &RedisBroker,
) -> Result<Self::Subscriber, RedisError>
async fn subscribe( self, broker: &RedisBroker, ) -> Result<Self::Subscriber, RedisError>
Auto Trait Implementations§
impl !RefUnwindSafe for RedisList
impl !UnwindSafe for RedisList
impl Freeze for RedisList
impl Send for RedisList
impl Sync for RedisList
impl Unpin for RedisList
impl UnsafeUnpin for RedisList
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