RetryOptions constructor

RetryOptions({
  1. int maxAttempts = 3,
  2. Duration baseDelay = const Duration(milliseconds: 200),
  3. Duration maxDelay = const Duration(seconds: 30),
  4. bool retryWrites = false,
  5. Set<int> statuses = const {408, 429, 500, 502, 503, 504},
})

Implementation

RetryOptions(
    {this.maxAttempts = 3,
    this.baseDelay = const Duration(milliseconds: 200),
    this.maxDelay = const Duration(seconds: 30),
    this.retryWrites = false,
    Set<int> statuses = const {408, 429, 500, 502, 503, 504}})
    : statuses = Set.unmodifiable(statuses) {
  if (maxAttempts < 1 || baseDelay < Duration.zero || maxDelay < baseDelay) {
    throw ArgumentError('Invalid retry budget.');
  }
}