Code Monkey home page Code Monkey logo

Comments (7)

amotl avatar amotl commented on May 29, 2024 1

Dear Andrea,

thank you for writing in.

Are there any plans to support/switch to an async client like httpx in place of requests?

It isn't planned yet, but we will be happy to take it into consideration.

It would be useful for using it within web services without blocking concurrency.

We can see the need for such scenarios. Let's use this ticket to maybe collect more voices from the community about how strong the needs are beyond your initiative, which we appreciate.

an async client like httpx

We guess using httpx is the way to go on this matter? Are there any alternatives yet? urllib3 will stay in synchronous lands, so far?

With kind regards,
Andreas.

/cc @hramezani

from grafana-client.

sanzoghenzo avatar sanzoghenzo commented on May 29, 2024 1

I've suggested httpx because it's my go-to library for async requests these days, but the trustworthy aiohttp is also an option.
In comparison with aiohttp, though, httpx can be used both sycronously and asyncronously, and supports HTTP/2; by contrast, aiohttp is faster (but doesn't decode JSON automatically as requests and httpx do).

from grafana-client.

Ousret avatar Ousret commented on May 29, 2024 1

Hello,

There's a 3rd option you may consider, staying with Requests but "upgrading" to https://github.com/jawah/niquests
Happy to hear your opinion on the matter.

from grafana-client.

amotl avatar amotl commented on May 29, 2024 1

Hi again,

Niquests, advertising itself as a drop-in replacement for Requests, sounds intriguing 1, so we would like to give it a spin. In order to evaluate interest within the community, please vote 👍 on the original post by @sanzoghenzo. At the same time, a corresponding pull request would be very much welcome.

With kind regards,
Andreas.

Footnotes

  1. Thanks, @Ousret.

from grafana-client.

Ousret avatar Ousret commented on May 29, 2024 1

Thank you for considering Niquests, I'd be happy to help and support the initiative.
Let me know if you need anything.

from grafana-client.

amotl avatar amotl commented on May 29, 2024

urllib3 will stay in synchronous lands, so far?

On this matter, it was easy to discover those discussions.

Do you have any pragmatic recommendations for us, @hramezani?

  • Wait for urllib3 version 3 to have full async support?
  • Just use httpx?
  • Use a different library?

from grafana-client.

sanzoghenzo avatar sanzoghenzo commented on May 29, 2024

I can see the benefit of a drop in replacement, but since we're talking about switching to async, the drop-in replacement is only half of the sotry: all the methods of the AsyncSession and responses needs to be awaited, and the functions containing these calls needs to be in turn async.

Anyway, I no longer have the need for this request since I only needed a few endpoints, and I was a bit disappointed when I realized that there's no object de/serialization (using dataclasses, pydantic, attrs, msgspec...) in this library.

Feel free to close this if nobody else need an async version!

from grafana-client.

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.