cognitedata / cognite-sdk-python

Cognite Python SDK
https://cognite-sdk-python.readthedocs-hosted.com/
Apache License 2.0
77 stars 27 forks source link

Replace requests with aiohttp #983

Open erlendvollset opened 2 years ago

erlendvollset commented 2 years ago

We can get performance improvements (both wrt. memory and time) by moving to asyncio and aiohttp. We can let our internal APIs be async, and then use something like this to still support the sync interface we have today. Longer term we can expose a public async API aswell.

This will require significant changes to both HTTPClient/APIClient as well as the unit tests as these are tightly coupled with the requests library by using the responses mocking library.

thomafred commented 1 year ago

Any update on this? Async support in general would be extremely welcome :)

haakonvt commented 2 months ago

@thomafred I've begun the work to move to httpx (which support both sync and async). The plan is as follows: replace requests with as few surprises as possible, then later design and decide on how we should expose the async API 😄

thomafred commented 2 months ago

@thomafred I've begun the work to move to httpx (which support both sync and async). The plan is as follows: replace requests with as few surprises as possible, then later design and decide on how we should expose the async API 😄

Awesome :)