-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to run async code from current class in pymethods #3
Comments
Actually, this crate was a POC, and I should be archived and deprecated when I will find the time for that. First PRs have been merged, and a few of them are still waiting review. The last one PyO3/pyo3#3613 corresponds to expected final state of async support, with exciting features like So, if you can, I suggest you to use the branch of the linked PR for your PyO3 version. By the way, the feature you need is implemented in PyO3/pyo3#3609, which it's the next PR to be reviewed. |
@wyfo I guess I'm a bit lucky. I just want to write a async data loading framework for deep learning today. After searching all day, I find your promising work. Looking forward to using it soon。 |
a little ping
when try to write some async code |
From your example we can run async code like this. However, it's not clear to me how I can invoke async functions from the same class. Image I have to call another async method from
this
, how would I do that?Example.
Also, I cannot return a future here because the
gil
lifetime will expire. I can use theasync_std::task::block_on
inside the GIL block but it would be nice to have something cleaner that keeps living on the same async loop.The text was updated successfully, but these errors were encountered: