http_extensions_retry 1.0.0 copy "http_extensions_retry: ^1.0.0" to clipboard
http_extensions_retry: ^1.0.0 copied to clipboard

An http extension that retries failed requests.

http_extensions : retry #

An [http extension] that retries failed requests.

Usage #

final client = ExtendedClient(
  inner: Client(),
  extensions: [
    RetryExtension(
        logger: Logger("Retry"),
        defaultOptions: RetryOptions(
          const RetryOptions(
      retries: 3, // Number of retries before a failure
      retryInterval: const Duration(seconds: 5), // Interval between each retry
      retryEvaluator: (error, response) => error != null, // Evaluating if a retry is necessary regarding the error or the response. It is a good candidate for updating authentication token in case of a unauthorized error (be careful with concurrency though). error or response are at least null
        )),
  ],
);
0
likes
100
pub points
0%
popularity

Publisher

unverified uploader

An http extension that retries failed requests.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

http, http_extensions, logging, meta

More

Packages that depend on http_extensions_retry