an actual async AsyncIterator
example
#4234
Unanswered
folkertdev
asked this question in
Questions
Replies: 1 comment
-
Heys, I implemented an example async iterator for streaming API responses. Perhaps this could be helpful? https://github.com/jregistr/python-stream-async-pyo3/blob/main/stream-q/src/lib.rs#L142 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi, does someone have a practical example of a rust stream/async iterator that is exposed to python as an async iterator?
this page https://pyo3.rs/main/migration#iteranextoutput-are-deprecated has an example, but what it implements is not actually an async iterator?! there are no awaits on the rust side anyway, so its asynchronous behavior is trivial. I want something like this
but apparently the
__anext__
method cannot be anasync fn
, even if I make it simplerI get this error (no idea what to do with that)
this post #4064 seems related but never got a proper answer.
Beta Was this translation helpful? Give feedback.
All reactions