Code Monkey home page Code Monkey logo

Comments (7)

jhalterman avatar jhalterman commented on June 12, 2024 1

Maybe a wording change that does both...

It might be good to move the "Duration" section of the Retry docs to be right below the "Attempts" section, since they both serve the same purpose of constraining executions, as you point out. For proposed wording on "Duration", which would directly follow "Attempts", maybe:

In addition to max attempts, you can also add a max duration for an execution, after which retries will stop if the max attempts haven't already been reached.

Would those two changes clarify things?

from failsafe.

stefanrybacki avatar stefanrybacki commented on June 12, 2024 1

@jhalterman sounds good, I could also image that an example with both maxDuration and maxRetries set to -1 would also make it even clearer

from failsafe.

jhalterman avatar jhalterman commented on June 12, 2024 1

I just pushed this change and also added a note about disabling retries: failsafe-lib/failsafe.dev@4ae3ec3

from failsafe.

Tembrel avatar Tembrel commented on June 12, 2024

So you want to emphasize that maxDuration doesn't supersede maxRetries/Attempts? Would this addition make it clear?

You can add a max duration for an execution, after which retries will stop (if not stopped by other constraints, like maxRetries/Attempts).

from failsafe.

stefanrybacki avatar stefanrybacki commented on June 12, 2024

Yes exactly I ran into this today wondering why only 3 attempts were taking place, only rereading the duration section I was confused. However, after reading the javadoc of withMaxDuration it dawned on me.

Regarding your proposed wording I still find it missleading as I never specified maxRetries so I would not assume other constraints as I already have specified a stop constraint via duration. So maybe also add a note to your proposal, something along the lines:

You can add a max duration for an execution, after which retries will stop (if not stopped by other constraints, like maxRetries/Attempts, Note: maxRetries is set to 3 if not overridden).

from failsafe.

Tembrel avatar Tembrel commented on June 12, 2024

@jhalterman - Would you want a wording change here, or an earlier emphasis on how maxRetries/Attempts is always considered, or both?

from failsafe.

stefanrybacki avatar stefanrybacki commented on June 12, 2024

@jhalterman much better now, thank you for the quick fix

from failsafe.

Related Issues (20)

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.