Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for subscribing with exactly-once delivery #236

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions pubsub/src/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RetrySetting>) -> Result<Vec<ReceivedMessage>, Status> {
#[allow(deprecated)]
let req = PullRequest {
Expand All @@ -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;
Expand Down