Giter Site home page Giter Site logo

Add a Resolver interface about ureq HOT 4 CLOSED

algesten avatar algesten commented on May 15, 2024
Add a Resolver interface

from ureq.

Comments (4)

rawler avatar rawler commented on May 15, 2024 1

I have a use-case for this in a production-environment, where I'd like to ensure the "spread" of requests are even between hosts. (Basically round-robin). I'll whip up a PR and let's see what you think.

from ureq.

lolgesten avatar lolgesten commented on May 15, 2024

@jsha in hreq i got this https://docs.rs/hreq/0.3.0/hreq/trait.RequestBuilderExt.html#tymethod.with_override

Would something like that work here too? it effectively makes it so the entry URI is masked by the override host/port/tls setting. That also works on redirects, so if you follow a redirect chain:

URI1 -> URI2 -> URI1

also when you get redirected back to URI1, the override kicks in.

from ureq.

jsha avatar jsha commented on May 15, 2024

Yep, the with_override method looks like a great solution! My inclination would be to enforce that it's test-only via #[cfg(test)] until someone comes along with a use case that strongly motivates making it public.

from ureq.

lolgesten avatar lolgesten commented on May 15, 2024

Sure! Let's gate.

from ureq.

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.