googleapis / googleapis/google-cloud-cpp

Sharing a pool of gRPC threads/connections with N topics for Pub/Sub?

オープン
#13,707 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る
type: feature request
主要言語
C++
スター
659
フォーク
462
平均マージ
1日 2時間
マージ済み PR(30日)
89

説明

**What component of `google-cloud-cpp` is this feature request for?**
Pub/Sub

**Is your feature request related to a problem? Please describe.**
Thanks for a great product. I've been looking at your samples for using the Pub/Sub publisher class. There is one example in particular where it shows you how to pass in your own thread pool:
https://cloud.google.com/cpp/docs/reference/pubsub/latest/classgoogle_1_1cloud_1_1pubsub_1_1Publisher#thread-safety

I had some suspicions about gRPC connections and the like, so I dug into the source code.

Each call of `MakePublisherConnection` is still tied to a topic. It is unclear if can use the same thread pool for multiple calls to `MakePublisherConnection` or not. Inside `MakePublisherConnection` I see gRPC channels being connected per thread, so I'm assuming that it's not expected to use the same thread pool across multiple topics?

That leaves me to my point of confusion. What is the expected usage for a scenario that I would assume is common:
1. You have multiple topics you publish to
2. You want a pool of gRPC connections that can be shared across all topics

**Describe the solution you'd like**
I would like a sample to document that, or even have this issue be the documentation.

**Describe alternatives you've considered**
I am currently iterating on ways I can play with the API to do what I expect, but it isn't ideal.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Pub/Sub Publisher のスレッドセーフティに関するリファレンスと、issue で言及されている MakePublisherConnection の実装から始めてください。1 つのスレッドプールを複数の topic 間で共有できるかどうかを確認し、そのうえでサンプルまたは焦点を絞ったガイダンスを使って想定される使用方法を文書化してください。複数 topic の接続とスレッドプールの動作が明確になれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp, gcp, grpc
領域
documentation
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。