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

Update RetrySettings guide to use the java.time methods #11027

Open
alicejli opened this issue Jul 24, 2024 · 0 comments
Open

Update RetrySettings guide to use the java.time methods #11027

alicejli opened this issue Jul 24, 2024 · 0 comments
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: docs Improvement to the documentation for an API.

Comments

@alicejli
Copy link
Contributor

https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md has some sample code that uses the gax methods for setting RetrySettings that use java.threeten. Given googleapis/sdk-platform-java#1872 has been merged, we should update the guide to make use of the new methods that use java.time to encourage users to use those methods instead.

For example:

settings =
    RetrySettings.newBuilder()
    .setInitialRpcTimeout(Duration.ofMillis(60000L))
    .setRpcTimeoutMultiplier(1.0)
    .setMaxRpcTimeout(Duration.ofMillis(60000L))
    .setTotalTimeout(Duration.ofMillis(60000L))
    .build();

should be rewritten to:

settings =
    RetrySettings.newBuilder()
    .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L))
    .setRpcTimeoutMultiplier(1.0)
    .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L))
    .setTotalTimeoutDuration(Duration.ofMillis(60000L))
    .build();
@alicejli alicejli added type: docs Improvement to the documentation for an API. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

No branches or pull requests

1 participant