MCPcopy Create free account
hub / github.com/NVIDIA/NeMo-Relay / next_async_iter_coro

Function next_async_iter_coro

crates/python/src/py_callable.rs:103–117  ·  view source on GitHub ↗
(async_iter: &Arc<Py<PyAny>>)

Source from the content-addressed store, hash-verified

101}
102
103fn next_async_iter_coro(async_iter: &Arc<Py<PyAny>>) -> FlowResult<Option<Py<PyAny>>> {
104 Python::attach(|py| {
105 let iter = async_iter.bind(py);
106 match iter.call_method0("__anext__") {
107 Ok(coro) => Ok(Some(coro.unbind())),
108 Err(error) => {
109 if error.is_instance_of::<pyo3::exceptions::PyStopAsyncIteration>(py) {
110 Ok(None)
111 } else {
112 Err(FlowError::Internal(error.to_string()))
113 }
114 }
115 }
116 })
117}
118
119async fn await_async_iter_value(coro: Py<PyAny>) -> FlowResult<Option<Json>> {
120 let future = Python::attach(|py| {

Callers 1

forward_async_iterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected