Git Product home page Git Product logo

Comments (5)

mrkkrp avatar mrkkrp commented on July 4, 2024

I'm not sure how common this need is, yet it'd cause a lot of breaking changes. If we need to allow access to MonadHttp instance then HttpConfig should be parametrized over some m to contain RetryPolicyM m inside...

from req.

jkachmar avatar jkachmar commented on July 4, 2024

Yeah, I'm not entirely convinced that it's worth it versus simply "disabling" the built-in retry policy (httpConfigRetryPolicy = limitRetries 0 or something) and then using the retry package directly with my own RetryPolicyM (parameterized with my application's type) and retrying.

It wouldn't be much extra work, just that I'd have to replicate some of the req functionality on my own.

from req.

ramirez7 avatar ramirez7 commented on July 4, 2024

How about changing from

httpConfigRetryPolicy :: RetryPolicy

to

httpConfigRetryPolicy :: RetryPolicyM IO

since Req is IO anyways (and MonadHttp requires MonadIO). This retry policy can then be lifted internally to Req via natTransformRetryPolicy liftIO.

This wouldn't require any breaking changes, but it would fix the largest drawback (imo) of the current approach: fullJitterBackoff cannot be used due to its requirement of IO.

from req.

mrkkrp avatar mrkkrp commented on July 4, 2024

@ramirez7 Do you want to prepare a PR?

from req.

ramirez7 avatar ramirez7 commented on July 4, 2024

👍 yep I'm on it

from req.

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.