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
spanner: update the code sample to set timeout at method level #3805
Comments
@hengfengli The current sample shows how to set both custom timeout and retry settings. The new feature that we added supports setting a timeout per method call, but not retry settings. So there are a couple of possible changes that we could do:
My preference would be option 1, as it keeps the sample relatively simple and shows the most common use case. Setting a custom timeout is something many users might want to do, setting custom retry codes is not something many users would (should) do. WDYT? |
Use the newly added feature that allows a client to set a custom timeout for a method call, instead of using the static option when creating a client. Fixes GoogleCloudPlatform#3805
@olavloite Sorry for the late reply. Option 1 sounds okay to me. But the only issue is that now we have a public page for this code sample: https://cloud.google.com/spanner/docs/custom-timeout-and-retry. If we choose Option 1, then the code does not match the text. |
Hmm... Then I don't think we should use option 1, at least not for this specific sample. I would then suggest adding a separate sample for only setting a timeout for a specific call. That won't show up in the documentation page, but at least people could find it in the sample code. |
The plan sounds good to me. |
What's the status of this? |
Adds a sample for setting a timeout for a single RPC. Fixes GoogleCloudPlatform/java-docs-samples#3805
Thanks for the ping, this had unfortunately fallen of my radar. The Spanner samples are currently (also) in the @thiagotnunes Do you know what the status is of the samples at the moment? Should we add them to both the repositories? Or should they only be added to |
@olavloite only |
* docs: add sample for timeout for one RPC Adds a sample for setting a timeout for a single RPC. Fixes GoogleCloudPlatform/java-docs-samples#3805 * fix: fix import order * fix: format code with the correct formatter plugin * fix: delete test data after each test * fix: auto-throttle admin requests
* docs: add sample for timeout for one RPC Adds a sample for setting a timeout for a single RPC. Fixes GoogleCloudPlatform/java-docs-samples#3805 * fix: fix import order * fix: format code with the correct formatter plugin * fix: delete test data after each test * fix: auto-throttle admin requests
The current code sample of setting the custom timeout is based on the client level. We recently have added the ability to set the timeout at the method level: googleapis/java-spanner#379. Are we able to update the existing code sample?
The text was updated successfully, but these errors were encountered: