Git Product home page Git Product logo

Comments (4)

JensRantil avatar JensRantil commented on September 26, 2024

Somewhat related, isn't a "generic callable" more like a Runnable? I would like to have support for giving a Runnable, but that would probably also require some refactoring to have different types of Retryers.

from guava-retrying.

jalaziz avatar jalaziz commented on September 26, 2024

I think I was thinking more along the lines of RunnableFuture. The idea is that I would like to build a single retryer that works for any number of callables with arbitrary return types. This would probably lose out on the ability to retry on a specific return value. I took a pass at it, but Java's type system (and type erasure) made it really annoying to implement cleanly.

Full disclosure, I no Java expert.

from guava-retrying.

JensRantil avatar JensRantil commented on September 26, 2024

@jalaziz I see. Did you try to use a Callable<Object> and do type checking of the result? Would that work?

from guava-retrying.

jalaziz avatar jalaziz commented on September 26, 2024

It would, but it sacrifices type safety and is less convenient (having to cast every result would be a pain). It's not that much of a concern anymore, though, as I've started transitioning to Scala where this type of thing is much easier to do.

from guava-retrying.

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.