(future: F)
| 132 | /// Wait for the future to resolve, blocking the current thread until it does |
| 133 | #[cfg(feature = "tokio")] |
| 134 | pub fn block_on_future<F: std::future::Future>(future: F) -> F::Output { |
| 135 | let rt = tokio::runtime::Builder::new_current_thread() |
| 136 | .enable_all() |
| 137 | .build() |
| 138 | .unwrap(); |
| 139 | rt.block_on(future) |
| 140 | } |
| 141 | |
| 142 | /// Wait for the oneshot receiver `source_tx` to either receive or a message or to disconnect, |
| 143 | /// then trigger `f`. Returns a new receiver that mimics the source one. |