NostrRetryPolicy class
Policy for retrying failed operations with configurable backoff strategies.
Constructors
- NostrRetryPolicy({int maxAttempts = 3, int initialDelayMs = 100, int maxDelayMs = 5000, double backoffMultiplier = 2.0})
-
Policy for retrying failed operations with configurable backoff strategies.
const
- NostrRetryPolicy.exponential({int maxAttempts = 3, int initialDelayMs = 100, int maxDelayMs = 5000})
-
Exponential backoff policy (doubling delay).
factory
- NostrRetryPolicy.linear({int maxAttempts = 3, int delayMs = 1000})
-
Linear backoff policy (constant delay).
factory
- NostrRetryPolicy.none()
-
No retry policy (single attempt).
factory
Properties
- backoffMultiplier → double
-
Backoff multiplier for exponential backoff.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialDelayMs → int
-
Initial delay before first retry in milliseconds.
final
- maxAttempts → int
-
Maximum number of retry attempts.
final
- maxDelayMs → int
-
Maximum delay between retries in milliseconds.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getDelayForAttempt(
int attemptNumber) → Duration - Get the delay for retry attempt.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRetry(
int attemptNumber) → bool - Check if should retry based on attempt number.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited