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

Asynchronous Writes/Reads #187

Open
aosterthun opened this issue Jul 17, 2019 · 4 comments
Open

Asynchronous Writes/Reads #187

aosterthun opened this issue Jul 17, 2019 · 4 comments
Milestone

Comments

@aosterthun
Copy link

This feature is currently only available in c++. Any chance somebody could write the python wrapper for this in the near future ?

If not, dispatching the write operation in a new thread should work fine, shoudn't it ?

@jakebolewski
Copy link
Contributor

jakebolewski commented Jul 17, 2019

All the IO / cpu intensive operations do give up the GIL, so usually the best option is to dispatch the write on another thread and then get a future to that (blocking) operation.

Full async support (integration with the event loop), probably should follow after making the above operation (which you can do now) a bit more user friendly and documented.

@ocehugo
Copy link

ocehugo commented Mar 5, 2020

Full async support (integration with the event loop), probably should follow after making the above operation (which you can do now) a bit more user friendly and documented.

Hi @jakebolewski - is this too far away still? I'm happy to code some manual stuff but some documentation with any idiosyncrasies around the c++/python api would help.

PS: I'm available to help since I got an ongoing related project that would benefit from this.

@ihnorton ihnorton added this to the 0.6 milestone Mar 5, 2020
@ihnorton
Copy link
Member

ihnorton commented Mar 5, 2020

Hi @ocehugo, are you looking specifically for integration with Python 3's async/await? At some point I looked in to this and saw that Cython doesn't support the async annotation on cdef functions, but I'll take a look again soon to try to work around that (it's not clear to me how strict the interpreter is about functions defined in C -- at worst we can probably hack in the attribute it wants).

Pull-requests very welcome of course! 😄

@ocehugo
Copy link

ocehugo commented Mar 8, 2020

@ihnorton yeap - python 3.6+ probably, since some breaking API changes happened before that.

I'm happy to push something but I'm not familiar with the API internals and the C++ code. I'm just a very ordinary user ATM. Im a bit rust in cython but played with it before. If you could get me some direction or where to look for the core things It can help a lot.

FYI: My main objective is to do Async fetching on object storage, mostly dense gridded stuff and associated metadata with time-x-y ranges.

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

No branches or pull requests

4 participants