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(v2): add WithTimeout option #259

Merged
merged 5 commits into from
Mar 15, 2023
Merged

Conversation

noahdietz
Copy link
Contributor

@noahdietz noahdietz commented Mar 1, 2023

Add new option WithTimeout(time.Duration), which will set an overall timeout for the entirety of an Invoke execution. This means that N APICall attempts can be made within the WithTimeout specified time.Duration.

Concretely it works by applying the given time.Duration to the context.Context given to Invoke via the context.WithTimeout API. For backwards compatibility, an existing deadline set on the context.Context will always take precedence.

Fixes: #249

@noahdietz noahdietz marked this pull request as ready for review March 10, 2023 20:15
@noahdietz noahdietz requested a review from a team as a code owner March 10, 2023 20:15
Copy link
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@noahdietz noahdietz enabled auto-merge (squash) March 15, 2023 16:49
@noahdietz noahdietz merged commit 9a8da43 into googleapis:main Mar 15, 2023
@noahdietz noahdietz deleted the with-timeout branch March 15, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

introduce a CallOption to supply a timeout for the context used in Invoke
2 participants