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

feat(pubsub): blocking pulls #10317

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Nov 28, 2022

This adds blocking pulls to the Pub/Sub public APIs. It also includes a minimal example, and an integration test.

Fixes #7187


This change is Reviewable

This adds blocking pulls to the Pub/Sub public APIs. It also includes
a minimal example, and an integration test.
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Nov 28, 2022
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 2565236772396656752f97dbf705450f35ee7369

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Nov 28, 2022

Codecov Report

Base: 93.84% // Head: 93.84% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (f6cec5f) compared to base (0a6fe59).
Patch coverage: 90.90% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10317   +/-   ##
=======================================
  Coverage   93.84%   93.84%           
=======================================
  Files        1594     1594           
  Lines      144970   145009   +39     
=======================================
+ Hits       136044   136084   +40     
+ Misses       8926     8925    -1     
Impacted Files Coverage Δ
...cloud/pubsub/internal/subscription_session_test.cc 97.98% <ø> (ø)
google/cloud/pubsub/subscriber_connection.cc 68.62% <0.00%> (-2.81%) ⬇️
google/cloud/pubsub/subscriber_connection.h 0.00% <ø> (ø)
google/cloud/pubsub/subscriber_connection_test.cc 100.00% <ø> (ø)
...b/integration_tests/subscriber_integration_test.cc 98.65% <100.00%> (+0.08%) ⬆️
...loud/pubsub/internal/subscriber_connection_impl.cc 95.34% <100.00%> (ø)
google/cloud/pubsub/samples/samples.cc 90.78% <100.00%> (+0.08%) ⬆️
google/cloud/pubsub/subscriber.cc 100.00% <100.00%> (ø)
...e/cloud/pubsublite/internal/alarm_registry_impl.cc 97.05% <0.00%> (-2.95%) ⬇️
...bigtable/examples/bigtable_hello_instance_admin.cc 83.00% <0.00%> (+2.00%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

* the invocation succeeds. With best-efforts subscriptions, the service *may*
* redeliver the message, even after a successful `handler.ack()` invocation.
*
* If `handler` is not an rvalue, you may need to use `std::move(ack).ack()`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/std::move(ack)/std::move(handler)/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -0,0 +1,55 @@
// Copyright 2020 Google LLC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

}
EXPECT_THAT(ids, Not(IsEmpty()));

auto const count = 2 * ids.size();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we do 2*N iterations for an exactly-once subscription?

Is it to make sure everything gets acked, in the failure case where we continue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. For low values of "make sure".

* @par Idempotency
* @parblock
* This is an idempotent operation; it only reads messages from the service.
* Will make multiple attempts to pull a message from the service, subject
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Will/It will/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@coryan coryan marked this pull request as ready for review November 28, 2022 23:34
@coryan coryan requested a review from a team as a code owner November 28, 2022 23:34
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: f6cec5f88a2c6b510dfa1b2b30c180d2bc1a2fdd

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@coryan coryan merged commit 1dfeae7 into googleapis:main Nov 29, 2022
@coryan coryan deleted the feat-pubsub-implement-blocking-pull-pr9 branch November 29, 2022 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create synchronous / blocking pull
3 participants