|
18 | 18 | //! be run on the same event loop.
|
19 | 19 | //!
|
20 | 20 | //! It's not immediately clear that this would provide worthwhile performance wins either, so in the
|
21 |
| -//! interest of keeping things simple, this crate runs both event loops independently and handles |
22 |
| -//! the communication between them. |
| 21 | +//! interest of keeping things simple, this crate creates and manages the Python event loop and |
| 22 | +//! handles the communication between separate Rust event loops. |
23 | 23 | //!
|
24 | 24 | //! ## Python's Event Loop
|
25 | 25 | //!
|
|
30 | 30 | //!
|
31 | 31 | //! ## Rust's Event Loop
|
32 | 32 | //!
|
33 |
| -//! Currently only the Tokio runtime is supported by this crate. Tokio makes it easy to construct |
34 |
| -//! and maintain a runtime that runs on background threads only and it provides a single threaded |
35 |
| -//! scheduler to make it easier to work around Python's GIL. |
| 33 | +//! Currently only the async-std and Tokio runtimes are supported by this crate. |
36 | 34 | //!
|
37 | 35 | //! > _In the future, more runtimes may be supported for Rust._
|
38 | 36 | //!
|
|
42 | 40 | //! <span
|
43 | 41 | //! class="module-item stab portability"
|
44 | 42 | //! style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"
|
| 43 | +//! ><code>async-std-runtime</code></span> |
| 44 | +//! are only available when the `async-std-runtime` Cargo feature is enabled: |
| 45 | +//! |
| 46 | +//! ```toml |
| 47 | +//! [dependencies.pyo3-asyncio] |
| 48 | +//! version = "0.13.0" |
| 49 | +//! features = ["async-std-runtime"] |
| 50 | +//! ``` |
| 51 | +//! |
| 52 | +//! Items marked with |
| 53 | +//! <span |
| 54 | +//! class="module-item stab portability" |
| 55 | +//! style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;" |
| 56 | +//! ><code>tokio-runtime</code></span> |
| 57 | +//! are only available when the `tokio-runtime` Cargo feature is enabled: |
| 58 | +//! |
| 59 | +//! ```toml |
| 60 | +//! [dependencies.pyo3-asyncio] |
| 61 | +//! version = "0.13.0" |
| 62 | +//! features = ["tokio-runtime"] |
| 63 | +//! ``` |
| 64 | +//! |
| 65 | +//! Items marked with |
| 66 | +//! <span |
| 67 | +//! class="module-item stab portability" |
| 68 | +//! style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;" |
45 | 69 | //! ><code>testing</code></span>
|
46 | 70 | //! are only available when the `testing` Cargo feature is enabled:
|
47 | 71 | //!
|
|
56 | 80 | #[doc(inline)]
|
57 | 81 | pub mod testing;
|
58 | 82 |
|
| 83 | +/// <span class="module-item stab portability" style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"><code>async-std-runtime</code></span> PyO3 Asyncio functions specific to the async-std runtime |
59 | 84 | #[cfg(feature = "async-std")]
|
60 | 85 | #[doc(inline)]
|
61 | 86 | pub mod async_std;
|
62 | 87 |
|
| 88 | +/// <span class="module-item stab portability" style="display: inline; border-radius: 3px; padding: 2px; font-size: 80%; line-height: 1.2;"><code>tokio-runtime</code></span> PyO3 Asyncio functions specific to the tokio runtime |
63 | 89 | #[cfg(feature = "tokio-runtime")]
|
64 | 90 | #[doc(inline)]
|
65 | 91 | pub mod tokio;
|
@@ -172,11 +198,11 @@ pub fn get_event_loop(py: Python) -> &PyAny {
|
172 | 198 |
|
173 | 199 | /// Run the event loop forever
|
174 | 200 | ///
|
175 |
| -/// This can be called instead of [`run_until_complete`] to run the event loop |
| 201 | +/// This can be called instead of `run_until_complete` to run the event loop |
176 | 202 | /// until `stop` is called rather than driving a future to completion.
|
177 | 203 | ///
|
178 |
| -/// After this function returns, the event loop can be resumed with either [`run_until_complete`] or |
179 |
| -/// [`run_forever`] |
| 204 | +/// After this function returns, the event loop can be resumed with either `run_until_complete` or |
| 205 | +/// [`crate::run_forever`] |
180 | 206 | ///
|
181 | 207 | /// # Arguments
|
182 | 208 | /// * `py` - The current PyO3 GIL guard
|
|
0 commit comments