GithubHelp home page GithubHelp logo

dio_retry's People

Contributors

aloisdeniel avatar amreniouinnovent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dio_retry's Issues

Retry callback bug

Hello! I found a bug with a retry callback. The module do only one call of given callback, after that it uses a default callback.
Here is a bugged code:
var shouldRetry = extra.retries > 0 && await extra.retryEvaluator(err);
to fix it we just have to change extra to options:
var shouldRetry = extra.retries > 0 && await options.retryEvaluator(err);

Allow dynamic retry interval (backoff)

I'd like to be able to control the backoff of the retries. Rather than a duration interval, maybe a intervalEvaluator function could be passed with the number of retries, so a interval can be determined.

Null safety

Hi, thanks for the package!

Are there any plans for migrating the package to use null safe?

Invalid constant value.dart(invalid_constant)

I got Invalid constant value.dart(invalid_constant)
for the following line:

retryEvaluator: (error) => error.type != DioErrorType.CANCEL && error.type != DioErrorType.RESPONSE,

How could I fix this error?

Not supported on latest version of dio

Please resolve and release a new version ASAP.

Because dio_retry >=0.1.9-beta depends on dio ^3.0.0 and ucertify_learn depends on dio ^4.0.0-beta4, dio_retry >=0.1.9-beta is forbidden.
So, because ucertify_learn depends on dio_retry ^0.1.9-beta, version solving failed.

can not set retryEvaluator

I saw the code and followed here: dio_retry
Global retry options

final dio = Dio()
  ..interceptors.add(RetryInterceptor(
    options: const RetryOptions(
      retries: 3, // Number of retries before a failure
      retryInterval: const Duration(seconds: 1), // Interval between each retry
      retryEvaluator: (error) => error.type != DioErrorType.CANCEL && error.type != DioErrorType.RESPONSE, // Evaluating if a retry is necessary regarding the error. It is a good candidate for updating authentication token in case of a unauthorized error (be careful with concurrency though)
    )
  )
);

but failed when setting up retryEvaluator

I tried to configure like example, but still got the same error.
It's a mistake or I haven't done it correctly, can anyone help me?

image

Please support dio 3.0.0

We have released version 3.0 of Dio, could you support it ๏ผŸ We will archive this plugin in the Dio documentation after it supports Dio 3.0. thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.