aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/backoff/backoff.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/backoff/backoff.h')
-rw-r--r--src/core/lib/backoff/backoff.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/core/lib/backoff/backoff.h b/src/core/lib/backoff/backoff.h
index 84ef9b82e4..de30e5268b 100644
--- a/src/core/lib/backoff/backoff.h
+++ b/src/core/lib/backoff/backoff.h
@@ -32,14 +32,11 @@ class BackOff {
/// Initialize backoff machinery - does not need to be destroyed
explicit BackOff(const Options& options);
- /// Begin retry loop: returns the deadline to be used for the next attempt,
- /// following the backoff strategy.
- grpc_millis Begin();
- /// Step a retry loop: returns the deadline to be used for the next attempt,
- /// following the backoff strategy.
- grpc_millis Step();
- /// Reset the backoff, so the next grpc_backoff_step will be a
- /// grpc_backoff_begin.
+ /// Returns the time at which the next attempt should start.
+ grpc_millis NextAttemptTime();
+
+ /// Reset the backoff, so the next value returned by NextAttemptTime()
+ /// will be the time of the second attempt (rather than the Nth).
void Reset();
void SetRandomSeed(unsigned int seed);
@@ -80,9 +77,10 @@ class BackOff {
private:
const Options options_;
+ uint32_t rng_state_;
+ bool initial_;
/// current delay before retries
grpc_millis current_backoff_;
- uint32_t rng_state_;
};
} // namespace grpc_core