MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / join

Function join

flow-rs/src/loader/python/utils.rs:39–47  ·  view source on GitHub ↗
(py: Python, tasks: Vec<PyObject>)

Source from the content-addressed store, hash-verified

37
38#[pyfunction]
39fn join(py: Python, tasks: Vec<PyObject>) -> Vec<PyObject> {
40 let mut futs = vec![];
41 for task in tasks.into_iter() {
42 futs.push(flow_rs::rt::task::spawn_local(stackful(move || {
43 Python::with_gil(|py| task.call0(py).unwrap())
44 })));
45 }
46 with_context(py, || wait(futures_util::future::join_all(futs)))
47}
48
49#[pyclass(name = "Future", unsendable)]
50struct PyFuture {

Callers 3

printerFunction · 0.85
main.pyFile · 0.85
mainFunction · 0.85

Calls 2

with_contextFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected