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): implement blocking publisher #10055

Merged
merged 3 commits into from
Oct 18, 2022

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Oct 17, 2022

Some applications need a simple way to publish a small number of event to several topics. Or they need to publish with a low rate to many topics. The pubsub::BlockingPublisher client is more convenient for such applications than the existing pubsub::Publisher. The latter is optimized for high-throughput clients publishing to a single topic.

Fixes #9301


This change is Reviewable

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Oct 17, 2022
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 115b6552a6b8aef577c27826b08f2ed1b79d700c

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

@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Base: 94.23% // Head: 94.23% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (9b214a5) compared to base (8cf365b).
Patch coverage: 90.08% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10055      +/-   ##
==========================================
- Coverage   94.23%   94.23%   -0.01%     
==========================================
  Files        1537     1541       +4     
  Lines      142068   142183     +115     
==========================================
+ Hits       133880   133981     +101     
- Misses       8188     8202      +14     
Impacted Files Coverage Δ
google/cloud/pubsub/samples/blocking_samples.cc 74.46% <74.46%> (ø)
google/cloud/pubsub/blocking_publisher.cc 100.00% <100.00%> (ø)
...cloud/pubsub/blocking_publisher_connection_test.cc 98.19% <100.00%> (+0.05%) ⬆️
google/cloud/pubsub/blocking_publisher_test.cc 100.00% <100.00%> (ø)
...ation_tests/blocking_publisher_integration_test.cc 100.00% <100.00%> (ø)
...sub/internal/blocking_publisher_connection_impl.cc 93.10% <100.00%> (+0.24%) ⬆️
.../pubsub/mocks/mock_blocking_publisher_connection.h 100.00% <100.00%> (ø)
google/cloud/internal/async_connection_ready.cc 89.36% <0.00%> (-4.26%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 97.98% <0.00%> (-0.51%) ⬇️
...sub/internal/batching_publisher_connection_test.cc 99.44% <0.00%> (-0.19%) ⬇️
... and 3 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.

@coryan coryan force-pushed the feat-pubsub-blocking-publisher-draft branch from 115b655 to a4765c5 Compare October 17, 2022 23:58
@coryan coryan marked this pull request as ready for review October 17, 2022 23:59
@coryan coryan requested a review from a team as a code owner October 17, 2022 23:59
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: a4765c5b73a9a59e4aea4aa5d6e760dd96afc2d1

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

namespace google {
namespace cloud {
namespace pubsub {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
Copy link
Member

Choose a reason for hiding this comment

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

nit: newline

* Publish messages to the Cloud Pub/Sub service.
*
* This class is used to publish messages to any given topic. It is intended
* for low-volume publishers: applications sending less than one message per
Copy link
Member

Choose a reason for hiding this comment

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

s/: applications/. Applications/

* the `ok()` member function in the `StatusOr<T>` returns `true` then it
* contains the expected result. Please consult the #google::cloud::StatusOr
* documentation for more details.
*
Copy link
Member

Choose a reason for hiding this comment

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

nit: extra blank line

Some applications need a simple way to publish a small number of event
to several topics.  Or they need to publish with a low rate to many
topics. The `pubsub::BlockingPublisher` client is more convenient for
such applications than the existing `pubsub::Publisher`. The latter is
optimized for high-throughput clients publishing to a single topic.
@coryan coryan force-pushed the feat-pubsub-blocking-publisher-draft branch from a4765c5 to 9b214a5 Compare October 18, 2022 19:25
@coryan coryan enabled auto-merge (squash) October 18, 2022 19:25
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 9b214a5b7031e0728a9835a4401df7315865c0fd

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

@coryan coryan merged commit e50c330 into googleapis:main Oct 18, 2022
@coryan coryan deleted the feat-pubsub-blocking-publisher-draft branch October 18, 2022 20:10
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 a simpler API to publish messages
3 participants