ProxyRetryPolicy class

A policy for retrying proxy operations

Constructors

ProxyRetryPolicy.new({int maxRetries = 3, Duration initialBackoff = const Duration(milliseconds: 500), Duration maxBackoff = const Duration(seconds: 30), double backoffMultiplier = 2.0, bool useJitter = true, Set<Type> retryableExceptions = const {ProxyConnectionError, ProxyTimeoutError, ProxyRateLimitedError}})
Creates a new ProxyRetryPolicy
const
ProxyRetryPolicy.exponentialBackoff({int maxRetries = 3, Duration initialBackoff = const Duration(milliseconds: 500), Duration maxBackoff = const Duration(seconds: 30), double backoffMultiplier = 2.0, bool useJitter = true, Set<Type>? retryableExceptions})
Creates a new ProxyRetryPolicy with exponential backoff
factory
ProxyRetryPolicy.fixedDelay({int maxRetries = 3, Duration delay = const Duration(seconds: 1), Set<Type>? retryableExceptions})
Creates a new ProxyRetryPolicy with a fixed delay
factory
ProxyRetryPolicy.noRetry()
Creates a new ProxyRetryPolicy with no retries
factory

Properties

backoffMultiplier double
The backoff multiplier
final
hashCode int
The hash code for this object.
no setterinherited
initialBackoff Duration
The initial backoff duration
final
maxBackoff Duration
The maximum backoff duration
final
maxRetries int
The maximum number of retries
final
retryableExceptions Set<Type>
The set of retryable exception types
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useJitter bool
Whether to add jitter to the backoff
final

Methods

copyWith({int? maxRetries, Duration? initialBackoff, Duration? maxBackoff, double? backoffMultiplier, bool? useJitter, Set<Type>? retryableExceptions}) ProxyRetryPolicy
Creates a copy of this ProxyRetryPolicy with the given parameters
execute<T>(Future<T> operation()) Future<T>
Executes an operation with retry logic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited