Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Client #53

Open
Jayclifford345 opened this issue Aug 25, 2023 · 7 comments
Open

Async Client #53

Jayclifford345 opened this issue Aug 25, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Jayclifford345
Copy link
Member

Jayclifford345 commented Aug 25, 2023

Check whether it is currently possible to create an Aysnc version of the client based on the underlining Arrow library.

  1. Write API currently supports Aysnc through parent library inheritance
    The support was removed at 56 remove v2 library dependency #62 (note by @bednar)
  2. Query API needs to be investigated
@Jayclifford345 Jayclifford345 added the enhancement New feature or request label Aug 25, 2023
@Jayclifford345 Jayclifford345 self-assigned this Aug 25, 2023
@thopewell
Copy link

thopewell commented Oct 30, 2023

@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: influxdata/influxdb-python#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:

@Jayclifford345
Copy link
Member Author

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

@LostInDarkMath
Copy link

Yes, an async client would be great :)

@Jayclifford345
Copy link
Member Author

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: apache/arrow#3151

@LostInDarkMath
Copy link

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?

@pvardanis
Copy link

Is it possible to run concurrent requests on an Arrow Flight RPC server without using an async FlightClient (since it doesn't exist yet)?

@jules-ch
Copy link

jules-ch commented Aug 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants