pub struct RedisPubSubSubscriber(/* private fields */);Expand description
A Pub/Sub subscription backed by a dedicated fred client, so its message stream and channel
state are isolated from other subscribers and from the publishing pool.
Pub/Sub delivers one message at a time, so the batches a BatchSubscriber hands out are
assembled on the client by the core’s BufferedSubscriber: it fills a batch up to the size
the mount site asked for and closes a partial one on its own deadline.
Trait Implementations§
Source§impl BatchSubscriber for RedisPubSubSubscriber
impl BatchSubscriber for RedisPubSubSubscriber
Source§fn batches(
&mut self,
size: NonZeroUsize,
) -> impl Stream<Item = Result<Self::Batch, Self::Error>> + Send + '_
fn batches( &mut self, size: NonZeroUsize, ) -> impl Stream<Item = Result<Self::Batch, Self::Error>> + Send + '_
Yields batches of at most size deliveries, assembled as they arrive.
§Cancel safety
Same as Subscriber::stream. A batch abandoned mid-fill
loses the deliveries it holds, as any Pub/Sub delivery nobody is polling for is lost.
Source§type Batch = Vec<RedisPubSubMessage>
type Batch = Vec<RedisPubSubMessage>
batches. Implementations choose between Vec, custom
iterators, or anything else that yields the underlying Subscriber::Message.Source§impl Debug for RedisPubSubSubscriber
impl Debug for RedisPubSubSubscriber
Source§impl Subscriber for RedisPubSubSubscriber
impl Subscriber for RedisPubSubSubscriber
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 Pub/Sub delivery.
§Cancel safety
Dropping the returned stream between items is safe. What arrives while no stream is polling waits in the subscription’s buffer; past it the oldest is lost, and while the subscription is disconnected everything is, as Redis Pub/Sub keeps nothing for a subscriber that is not there.
Source§type Message = RedisPubSubMessage
type Message = RedisPubSubMessage
Source§type Error = RedisError
type Error = RedisError
Auto Trait Implementations§
impl !RefUnwindSafe for RedisPubSubSubscriber
impl !UnwindSafe for RedisPubSubSubscriber
impl Freeze for RedisPubSubSubscriber
impl Send for RedisPubSubSubscriber
impl Sync for RedisPubSubSubscriber
impl Unpin for RedisPubSubSubscriber
impl UnsafeUnpin for RedisPubSubSubscriber
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