-
Notifications
You must be signed in to change notification settings - Fork 144
feat(pubsub): support publish hedging #6861
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,8 +140,8 @@ impl PublisherBuilder { | |
| /// .await?; | ||
| /// # Ok(()) } | ||
| /// ``` | ||
| pub fn set_hedging_options<V: Into<HedgingOptions>>(mut self, v: V) -> Self { | ||
| self.hedging_options = Some(v.into()); | ||
| pub fn set_hedging_options(mut self, v: HedgingOptions) -> Self { | ||
| self.hedging_options = Some(v); | ||
| self | ||
| } | ||
|
|
||
|
|
@@ -156,16 +156,13 @@ impl PublisherBuilder { | |
| /// # use google_cloud_pubsub::publisher::HedgingOptions; | ||
| /// # async fn sample() -> anyhow::Result<()> { | ||
| /// let publisher = Publisher::builder("projects/my-project/topics/my-topic") | ||
| /// .set_or_clear_hedging_options(None::<HedgingOptions>) | ||
| /// .set_or_clear_hedging_options(None) | ||
| /// .build() | ||
| /// .await?; | ||
| /// # Ok(()) } | ||
| /// ``` | ||
| pub fn set_or_clear_hedging_options<V>(mut self, v: Option<V>) -> Self | ||
| where | ||
| V: Into<HedgingOptions>, | ||
| { | ||
| self.hedging_options = v.map(Into::into); | ||
| pub fn set_or_clear_hedging_options(mut self, v: Option<HedgingOptions>) -> Self { | ||
| self.hedging_options = v; | ||
| self | ||
| } | ||
|
|
||
|
|
@@ -460,8 +457,8 @@ impl PublisherPartialBuilder { | |
| /// .build(); | ||
| /// # Ok(()) } | ||
| /// ``` | ||
| pub fn set_hedging_options<V: Into<HedgingOptions>>(mut self, v: V) -> Self { | ||
| self.hedging_options = Some(v.into()); | ||
| pub fn set_hedging_options(mut self, v: HedgingOptions) -> Self { | ||
| self.hedging_options = Some(v); | ||
| self | ||
| } | ||
|
|
||
|
|
@@ -478,15 +475,12 @@ impl PublisherPartialBuilder { | |
| /// # let client: BasePublisher = BasePublisher::builder().build().await?; | ||
| /// let publisher = client | ||
| /// .publisher("projects/my-project/topics/my-topic") | ||
| /// .set_or_clear_hedging_options(None::<HedgingOptions>) | ||
| /// .set_or_clear_hedging_options(None) | ||
| /// .build(); | ||
| /// # Ok(()) } | ||
| /// ``` | ||
| pub fn set_or_clear_hedging_options<V>(mut self, v: Option<V>) -> Self | ||
| where | ||
| V: Into<HedgingOptions>, | ||
| { | ||
| self.hedging_options = v.map(Into::into); | ||
| pub fn set_or_clear_hedging_options(mut self, v: Option<HedgingOptions>) -> Self { | ||
|
suzmue marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, we do have LGTM
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another argument for keeping the API is that an application might want to explicitly disable hedging in case the client library ever changes its default behavior. |
||
| self.hedging_options = v; | ||
| self | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.