From fcf8b73f8d6d99badbf6d02c560cb3f17c20b91b Mon Sep 17 00:00:00 2001 From: Julian Braha Date: Sun, 25 Feb 2024 12:45:20 -0500 Subject: [PATCH] pubsub: Improve documentation for exactly-once delivery --- pubsub/src/subscription.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pubsub/src/subscription.rs b/pubsub/src/subscription.rs index b9031af6..b01fa0c7 100644 --- a/pubsub/src/subscription.rs +++ b/pubsub/src/subscription.rs @@ -341,6 +341,8 @@ impl Subscription { /// pull get message synchronously. /// It blocks until at least one message is available. + /// + /// NOTE: this is the recommended function to use when receiving messages from a subscription with exactly-once delivery. pub async fn pull(&self, max_messages: i32, retry: Option) -> Result, Status> { #[allow(deprecated)] let req = PullRequest { @@ -366,6 +368,9 @@ impl Subscription { /// subscribe creates a `Stream` of `ReceivedMessage` /// Terminates the underlying `Subscriber` when dropped. + /// + /// NOTE: for subscriptions with exactly-once delivery, + /// use `pull` instead. /// ```no_test /// use google_cloud_pubsub::client::Client; /// use google_cloud_pubsub::subscription::Subscription;