You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of having a receive_message() method on the client, have the subscribe_* methods return a type holding a mut reference to the client, and implementing the Stream trait from the futures crate. Usage
let sub = client.subscribe_to_topic(...).await;
loop {
if let Ok(message) = sub.next().await {
// Process message
}
}
Then when sub goes out of scope, the client can be reused.
The text was updated successfully, but these errors were encountered:
Instead of having a receive_message() method on the client, have the subscribe_* methods return a type holding a mut reference to the client, and implementing the Stream trait from the futures crate. Usage
Then when sub goes out of scope, the client can be reused.
The text was updated successfully, but these errors were encountered: