RetryPolicy constructor

RetryPolicy(
  1. RetryConfig _config, {
  2. double random()?,
})

Creates a policy from a RetryConfig. random (returning values in the half-open range 0 to 1) is injectable for deterministic tests.

Implementation

RetryPolicy(this._config, {double Function()? random})
  : _random = random ?? math.Random().nextDouble;