pub struct PubsubClientSubscription<T>where
T: DeserializeOwned,{ /* private fields */ }
Expand description
A subscription.
The subscription is unsubscribed on drop, and note that unsubscription (and
thus drop) time is unbounded. See
PubsubClientSubscription::send_unsubscribe
.
Implementations§
Source§impl<T> PubsubClientSubscription<T>where
T: DeserializeOwned,
impl<T> PubsubClientSubscription<T>where
T: DeserializeOwned,
Sourcepub fn send_unsubscribe(&self) -> Result<(), PubsubClientError>
pub fn send_unsubscribe(&self) -> Result<(), PubsubClientError>
Send an unsubscribe message to the server.
Note that this will block as long as the internal subscription receiver is waiting on messages from the server, and this can take an unbounded amount of time if the server does not send any messages.
If a pubsub client needs to shutdown reliably it should use
the async client in crate::nonblocking::pubsub_client
.
Sourcepub fn shutdown(&mut self) -> Result<()>
pub fn shutdown(&mut self) -> Result<()>
Shutdown the internel message receiver and wait for its thread to exit.
Note that this will block as long as the subscription receiver is waiting on messages from the server, and this can take an unbounded amount of time if the server does not send any messages.
If a pubsub client needs to shutdown reliably it should use
the async client in crate::nonblocking::pubsub_client
.