- Notifications
You must be signed in to change notification settings - Fork35
[Design Document] First pass at async api options design#914
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Tagging@TomNicholas@kylebarron in case they have some insight or opinion! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is great@mpiannucci . It very clearly explains the options.
I don't think anybody will like "Classes with Async methods", or I don't at least (but it's great to keep it in the doc as an option).
I feel the option with_async_repo
and python doing the blocking is very compelling because of its simplicity and small code footprint. But, I'm concerned about having more async stuff in python, I have fought those async loops way more than I want to remember. For example, we would need to explore how well this interacts with multithreaded python code.
The everything-in-rust option is by far what takes more code, but also what feels safer. I'm afraid to ask, but ... how about writing a macro that can generate both versions of every method?
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Sebastián Galkin <code@amisdelabc.com>
mpiannucci commentedApr 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This is my exact worry as well. A macro actually might be the best way to do this, because the inner async closure will be the same for both sync and async and the only thing that changes are the call signatures and the runtime wrapper. I'll look into that |
Exactly. Maybe we can do a small proof of concept and see how it goes. The other concern with this is that we still need to create both python classes calling to the proper Rust object. I wonder if there are any tricks we play there without killing performance. |
kylebarron commentedApr 16, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
FWIW this is my preferred option 😄. E.g. in obstore the same operations are synchronous with I don't think there should be two separate classes that represent the same underlying concept and data on the rust side. E.g. for obstore the act of creating an S3Store is totally indifferent to whether you plan to use it synchronously or asynchronously. And the underlying Rust data ( Even when you might want an async constructor, I prefer having a single class. E.g. inkylebarron/arro3#313 I'm updating my I also prefer |
Thanks@kylebarron . This gives me a new appreciation for that option. |
First pass at design for bringing async API back to python#620
This currently makes no decisions but starts to lay out options to iterate on.