diff --git a/async-nats/src/lib.rs b/async-nats/src/lib.rs index 34cf05136..f6e20a527 100755 --- a/async-nats/src/lib.rs +++ b/async-nats/src/lib.rs @@ -84,6 +84,10 @@ //! for _ in 0..10 { //! client.publish(subject, data.clone()).await?; //! } +//! +//! // Flush internal buffer before exiting to make sure all messages are sent +//! client.flush().await?; +//! //! # Ok(()) //! # } //! ```