SmartRetry class

Static facade providing simple and ergonomic entry points into the execution framework.

Example usage:

final users = await SmartRetry.run(
  () => repository.fetchUsers(),
  policy: RetryPolicy.aggressive,
);

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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

Static Methods

run<T>(Future<T> task(), {RetryPolicy? policy, int? maxAttempts, Duration? maxDuration, Duration? perAttemptTimeout, BackoffStrategy? backoffStrategy, Duration? baseDelay, Duration? maxDelay, RetryCondition? retryCondition, RetryDecisionEngine? decisionEngine, RetryToken? token, RetryCallbacks<T>? callbacks, RetryLogger? logger, bool? connectivityAware, ConnectivityWaiter? connectivityWaiter}) Future<T>
Executes task with retry logic, automatically throwing the last error if retries are exhausted.
runResult<T>(Future<T> task(), {RetryPolicy? policy, int? maxAttempts, Duration? maxDuration, Duration? perAttemptTimeout, BackoffStrategy? backoffStrategy, Duration? baseDelay, Duration? maxDelay, RetryCondition? retryCondition, RetryDecisionEngine? decisionEngine, RetryToken? token, RetryCallbacks<T>? callbacks, RetryLogger? logger, bool? connectivityAware, ConnectivityWaiter? connectivityWaiter}) Future<RetryResult<T>>
Executes task with retry logic, returning a RetryResult without throwing when retries are exhausted.