add initial client tests (#25)
This commit is contained in:
@@ -187,6 +187,11 @@ pub struct Subscriber {
|
||||
|
||||
impl Subscriber {
|
||||
|
||||
/// get the list of subscribed channels
|
||||
pub fn get_subscribed(&self) -> &HashSet<String> {
|
||||
&self.subscribed_channels
|
||||
}
|
||||
|
||||
/// await for next message published on the subscribed channels
|
||||
pub async fn next_message(&mut self) -> crate::Result<Message> {
|
||||
match self.receive_message().await {
|
||||
|
||||
@@ -182,7 +182,7 @@ pub async fn run(listener: TcpListener, shutdown: impl Future) -> crate::Result<
|
||||
}
|
||||
|
||||
// Extract the `shutdown_complete` receiver and transmitter
|
||||
// ` explicitly drop shutdown_transmitter`. This is important, as the
|
||||
// explicitly drop `shutdown_transmitter`. This is important, as the
|
||||
// `.await` below would otherwise never complete.
|
||||
let Listener { mut shutdown_complete_rx, shutdown_complete_tx, .. } = server;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user