RetryWithJitter constructor

RetryWithJitter(
  1. RetryPolicy inner, {
  2. double jitterFactor = 0.5,
})

Creates a jittered retry policy

inner is the underlying retry policy to add jitter to. jitterFactor controls the amount of random variation (0.0 to 1.0).

Implementation

RetryWithJitter(this.inner, {double jitterFactor = 0.5})
    : jitterFactor = _validateRange(
        jitterFactor,
        'jitterFactor',
        min: 0.0,
        max: 1.0,
      ),
      _random = Random();