RetryPolicy class
The retry policy associated to a client.
This policy is used to determine if a request should be retried and when.
also see:
RetryQueue
Constructors
-
RetryPolicy.new({required FutureOr<
bool> shouldRetry(StreamChatClient client, int attempt, StreamChatError? error), int maxRetryAttempts = 6, Duration delayFactor = const Duration(milliseconds: 200), double randomizationFactor = 0.25, Duration maxDelay = const Duration(seconds: 30)}) - Instantiate a new RetryPolicy
Properties
- delayFactor → Duration
-
Delay factor to double after every attempt.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxDelay → Duration
-
Maximum delay between retries, defaults to 30 seconds.
final
- maxRetryAttempts → int
-
Maximum number of attempts before giving up, defaults to 6.
final
- randomizationFactor → double
-
Percentage the delay should be randomized, given as fraction between
0 and 1.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shouldRetry
→ FutureOr<
bool> Function(StreamChatClient client, int attempt, StreamChatError? error) -
Function to determine if a retry should be attempted.
final
Methods
-
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