cognite-sdk-python icon indicating copy to clipboard operation
cognite-sdk-python copied to clipboard

Replace requests with aiohttp

Open erlendvollset opened this issue 2 years ago • 3 comments

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.

erlendvollset avatar Jul 26 '22 10:07 erlendvollset

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

thomafred avatar Feb 15 '23 19:02 thomafred

@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 😄

haakonvt avatar Aug 21 '24 09:08 haakonvt

@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 :)

thomafred avatar Aug 22 '24 09:08 thomafred