RetryConfig constructor

RetryConfig({
  1. required int maxAttempts,
  2. Jitter? jitter,
  3. dynamic onExecute(
    1. RetryEvent event
    )?,
})

Returns the new instance of RetryConfig.

Implementation

RetryConfig({
  required this.maxAttempts,
  Jitter? jitter,
  this.onExecute,
}) : jitter = jitter ?? Jitter(maxInSeconds: 4) {
  if (maxAttempts < 0) {
    //! There is no use case where the number of retries is negative.
    throw ArgumentError.value(
      maxAttempts,
      'maxAttempts',
      'must be greater than or equal to 0',
    );
  }
}