questdb / py-questdb-client

Python client for QuestDB InfluxDB Line Protocol
https://py-questdb-client.readthedocs.io
Apache License 2.0
55 stars 10 forks source link

Is there any async api for python? #96

Closed PinappleUnderTheSea closed 3 days ago

PinappleUnderTheSea commented 4 days ago

Hi, I am using questDB for dumping stream data with async websocket connection. I want to know if there are async framwork in python sdk. Thanks!

amunra commented 4 days ago

Hi, For throughput, especially with dataframes, all the communication with the server is implemented in native code. I've toyed with the idea of providing an async wrapper over it, but there hasn't been overwhelming demand for it, and it has some limitations (like the loss of ability to auto-flush).

You can take a look (check outand try) the prototype in the async_pool branch.

It introduces a pool of senders and allows sending multiple requests in parallel (with true parallelism, sending is still in native code and releases the GIL).

There's also an async API variant there.

PR: https://github.com/questdb/py-questdb-client/pull/66

PR description is slightly out of date, take a look at the diff.

Feedback would be very welcome.

PinappleUnderTheSea commented 3 days ago

It is very useful to me !! Thanks