Giter Site home page Giter Site logo

withMaxDurationPerTry about failsafe HOT 4 CLOSED

failsafe-lib avatar failsafe-lib commented on August 19, 2024
withMaxDurationPerTry

from failsafe.

Comments (4)

jhalterman avatar jhalterman commented on August 19, 2024 1

@Tryio What you're thinking of sounds like a different use case - being able to interrupt or cancel a running execution. You can of course do that right now, manually, for synchronous executions via Thread.interrupt or asynchronous executions via FailsafeFuture.cancel, but there's not currently a timer that will do it for you if that's what you were thinking. We could consider something like that, but I'm hesitant to put it in unless there are a few really solid use cases.

from failsafe.

jhalterman avatar jhalterman commented on August 19, 2024

Hi @ZaziroZ - Something like this could make sense, but could also yield surprising behavior depending on how it's used. Are you thinking, basically, that retries would stop if/when maxDurationPerTry is exceeded? Also, can you give me an idea what your use case (or some other use cases) for this might be?

from failsafe.

lucaguada avatar lucaguada commented on August 19, 2024

Hi! Is it something for the RetryPolicy definition? If it's so it would be better «abortAfter(long, TimeUnit)», but anyway, the example/case may be the large files download scenario: let's assume I have several files that I need to download, I don't know the size, I don't know my end-user's connection speed and at least I want some of them right now. If one of them is big enough to slow down the process, then skip it.

What do you think about it?
Thx!

from failsafe.

jhalterman avatar jhalterman commented on August 19, 2024

Unless the OP has any more input/details on this (see my comment above), I'm closing for now.

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.