Open Jayclifford345 opened 1 year ago
@Jayclifford345 has any progress been made in the investigation into async on the query api for Influx3.0?
Similar to this discussion/issue in the v2 python client: https://github.com/influxdata/influxdb-python/issues/452 I'm adding an endpoint to an api, the endpoint will query influx 3.0 and return some data, but the framework I'm plugging into uses async.
I'm not sure how best to do this:
Hi @thopewell, I am currently struggling to create a clean solution for this since from what I can see underlining pyarrow flight library does not currently have an inherently Async solution. It might be something we need to raise with the greater pyarrow community
Yes, an async client would be great :)
Hi there, I belive we need to wait for the upstream library Pyarrow to implement the necessary functionality before we are able to move forward: https://github.com/apache/arrow/issues/3151
Thanks for your fast reply!
The issue you mentioned is closed and there is a linked gist. So I guess the gist is not enough to provide an async influxDB client?
Is it possible to run concurrent requests on an Arrow Flight RPC
server without using an async FlightClient (since it doesn't exist yet)?
I have been delegating queries to threads using the same client. I haven't seen any problems so far. I don't know if the Pyarrow implementation is thread safe. You can also use aiogrpc since Flight is using GRPC under the hood (tried it, it works but you need to deal with the IPC messages and header bytes). The pyArrow implementation is using the C++ client from the Python bindings with Cython which releases the GIL. Don't know about performance, just use pure sync and threads I'd say until pyarrow release an asynchronous version.
Check whether it is currently possible to create an Aysnc version of the client based on the underlining Arrow library.
Write API currently supports Aysnc through parent library inheritanceThe support was removed at #62 (note by @bednar)