You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -679,3 +677,27 @@ There have been a few changes to the API in order to support proper cancellation
679
677
-`scope` and `scope_local` variants now accept `TaskLocals` instead of `event_loop`. You can usually just replace the `event_loop` with `pyo3_asyncio::TaskLocals::new(event_loop).copy_context(py)?`.
680
678
- Return types for `future_into_py`, `future_into_py_with_locals``local_future_into_py`, and `local_future_into_py_with_locals` are now constrained by the bound `IntoPy<PyObject>` instead of requiring the return type to be `PyObject`. This can make the return types for futures more flexible, but inference can also fail when the concrete type is ambiguous (for example when using `into()`). Sometimes the `into()` can just be removed,
681
679
-`run`, and `run_until_complete` can now return any `Send + 'static` value.
680
+
681
+
### Migrating from 0.15 to 0.16
682
+
683
+
Actually, not much has changed in the API. I'm happy to say that the PyO3 Asyncio is reaching a
684
+
pretty stable point in 0.16. For the most part, 0.16 has been about cleanup and removing deprecated
685
+
functions from the API.
686
+
687
+
PyO3 0.16 comes with a few API changes of its own, but one of the changes that most impacted PyO3
688
+
Asyncio was it's decision to drop support for Python 3.6. PyO3 Asyncio has been using a few
689
+
workarounds / hacks to support the pre-3.7 version of Python's asyncio library that are no longer
690
+
necessary. PyO3 Asyncio's underlying implementation is now a bit cleaner because of this.
691
+
692
+
PyO3 Asyncio 0.15 included some important fixes to the API in order to add support for proper task
693
+
cancellation and allow for the preservation / use of contextvars in Python coroutines. This led to
694
+
the deprecation of some 0.14 functions that were used for edge cases in favor of some more correct
695
+
versions, and those deprecated functions are now removed from the API in 0.16.
696
+
697
+
In addition, with PyO3 Asyncio 0.16, the library now has experimental support for conversions from
698
+
Python's async generators into a Rust `Stream`. There are currently two versions `v1` and `v2` with
699
+
slightly different performance and type signatures, so I'm hoping to get some feedback on which one
700
+
works best for downstream users. Just enable the `unstable-streams` feature and you're good to go!
701
+
702
+
> The inverse conversion, Rust `Stream` to Python async generator, may come in a later release if
0 commit comments