[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/ZGeomantic/openapi/main/python/src/async_callback.rs [Back]  [Original]

//! Invoke a Python callback and, if it returns a coroutine and an event loop
//! is provided, schedule the coroutine on that loop (for use from non-asyncio
//! threads).

use pyo3::prelude::*;

/// If `result` is a coroutine and `event_loop` is `Some`, schedules it on the
/// loop via `asyncio.run_coroutine_threadsafe(coro, loop)`.
pub(crate) fn schedule_coro_if_needed(
    result: &Bound,
    event_loop: Option,
    py: Python

Web Proxy Viewer  |  New URL  |  Original Page