pub struct RedisSubscriber { /* private fields */ }Expand description
A Redis Streams subscription bound to a consumer group.
Constructed by crate::RedisBroker::subscribe from a crate::RedisStream descriptor. The
read mode (fresh tail vs reclaim) is fixed at construction.
Trait Implementations§
Source§impl BatchSubscriber for RedisSubscriber
impl BatchSubscriber for RedisSubscriber
Source§fn batches(
&mut self,
) -> impl Stream<Item = Result<Self::Batch, Self::Error>> + Send + '_
fn batches( &mut self, ) -> impl Stream<Item = Result<Self::Batch, Self::Error>> + Send + '_
Yields one batch per non-empty read (XREADGROUP COUNT / XAUTOCLAIM), up to
RedisStream::count entries. Never yields an empty batch.
§Cancel safety
Same as Subscriber::stream: dropping the stream mid-read leaves fetched-but-unacked
entries in the pending list.
Source§type Batch = Vec<RedisMessage>
type Batch = Vec<RedisMessage>
batches. Implementations choose between Vec, custom
iterators, or anything else that yields the underlying Subscriber::Message.Source§impl Debug for RedisSubscriber
impl Debug for RedisSubscriber
Source§impl Subscriber for RedisSubscriber
impl Subscriber for RedisSubscriber
Source§fn stream(
&mut self,
) -> impl Stream<Item = Result<Self::Message, Self::Error>> + Send + '_
fn stream( &mut self, ) -> impl Stream<Item = Result<Self::Message, Self::Error>> + Send + '_
Yields one message per entry, refilling from Redis when the local buffer drains.
§Cancel safety
Dropping the returned stream between items is safe. Dropping it while a read is in flight drops the read future; entries already delivered to this consumer but not yet acked stay in the group’s pending list and are redelivered (fresh mode) or reclaimable (reclaim mode).
Source§type Message = RedisMessage
type Message = RedisMessage
Source§type Error = RedisError
type Error = RedisError
Auto Trait Implementations§
impl !RefUnwindSafe for RedisSubscriber
impl !UnwindSafe for RedisSubscriber
impl Freeze for RedisSubscriber
impl Send for RedisSubscriber
impl Sync for RedisSubscriber
impl Unpin for RedisSubscriber
impl UnsafeUnpin for RedisSubscriber
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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