[−][src]Struct redis_async::client::pubsub::PubsubConnection
A shareable reference to subscribe to PUBSUB topics
Methods
impl PubsubConnection
[src][−]
pub async fn subscribe<'_, '_>(
&'_ self,
topic: &'_ str
) -> Result<PubsubStream, Error>
[src][−]
&'_ self,
topic: &'_ str
) -> Result<PubsubStream, Error>
Subscribes to a particular PUBSUB topic.
Returns a future that resolves to a Stream
that contains all the messages published on
that particular topic.
The resolved stream will end with redis_async::error::Error::EndOfStream
if the
underlying connection is lost for unexpected reasons. In this situation, clients should
subscribe
to re-subscribe; the underlying connect will automatically reconnect. However,
clients should be aware that resubscriptions will only succeed if the underlying connection
has re-established, so multiple calls to subscribe
may be required.
pub fn unsubscribe<T: Into<String>>(&self, topic: T)
[src][−]
Tells the client to unsubscribe from a particular topic. This will return immediately, the
actual unsubscription will be confirmed when the stream returned from subscribe
ends.
Trait Implementations
impl Clone for PubsubConnection
[src][+]
impl Debug for PubsubConnection
[src][+]
Auto Trait Implementations
impl Send for PubsubConnection
impl Sync for PubsubConnection
impl Unpin for PubsubConnection
impl !UnwindSafe for PubsubConnection
impl !RefUnwindSafe for PubsubConnection
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> From<T> for T
[src][+]
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,