Skip to content

Commit

Permalink
update spacing of docstring and update comment in code snippet to sho…
Browse files Browse the repository at this point in the history
…w how to use the minimum delay
  • Loading branch information
alevenberg committed May 18, 2023
1 parent f15b8b0 commit 28fb630
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 8 additions & 8 deletions google/cloud/internal/backoff_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ class ExponentialBackoffPolicy : public BackoffPolicy {
* @param maximum_delay the maximum value for the delay between operations.
* @param scaling how fast does the delay increase between iterations.
*
* @tparam Rep1 a placeholder to match the Rep tparam for @p
* initial_delay_range's type, the semantics of this template parameter are
* documented in `std::chrono::duration<>` (in brief, the underlying
* arithmetic type used to store the number of ticks), for our purposes it is
* simply a formal parameter.
* @tparam Rep1 a placeholder to match the Rep tparam for
* @p initial_delay_range's type, the semantics of this template parameter
* are documented in `std::chrono::duration<>` (in brief, the underlying
* arithmetic type used to store the number of ticks), for our purposes it
* is simply a formal parameter.
* @tparam Period1 a placeholder to match the Period tparam for
* @p initial_delay_range's type, the semantics of this template
* parameter are documented in `std::chrono::duration<>` (in brief, the length
* of the tick in seconds, expressed as a `std::ratio<>`), for our purposes it
* is simply a formal parameter.
* parameter are documented in `std::chrono::duration<>` (in brief, the
* length of the tick in seconds, expressed as a `std::ratio<>`), for our
* purposes it is simply a formal parameter.
* @tparam Rep2 similar formal parameter for the type of @p minimum_delay.
* @tparam Period2 similar formal parameter for the type of @p minimum_delay.
* @tparam Rep3 similar formal parameter for the type of @p maximum_delay.
Expand Down
5 changes: 3 additions & 2 deletions google/cloud/storage/examples/storage_object_samples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -580,12 +580,13 @@ google::cloud::storage::Client StorageRetries(std::vector<std::string> const&) {
// Retries only idempotent operations.
options.set<gcs::IdempotencyPolicyOption>(
gcs::StrictIdempotencyPolicy().clone());
// On error, it backs off for 1 second, then 3 seconds, then 9 seconds, etc.
// On error, it backs off for 2 seconds, then 5 seconds, then 14 seconds, etc.
// The backoff time never grows larger than 1 minute. The strategy introduces
// jitter around the backoff delay.
options.set<gcs::BackoffPolicyOption>(
gcs::ExponentialBackoffPolicy(
/*initial_delay=*/std::chrono::seconds(1),
/*initial_delay_range=*/std::chrono::seconds(1),
/*minimum_delay=*/std::chrono::seconds(1),
/*maximum_delay=*/std::chrono::minutes(1),
/*scaling=*/3.0)
.clone());
Expand Down

0 comments on commit 28fb630

Please sign in to comment.