(py: Python, tasks: Vec<PyObject>)
| 37 | |
| 38 | #[pyfunction] |
| 39 | fn 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)] |
| 50 | struct PyFuture { |
no test coverage detected