MCPcopy Create free account
hub / github.com/bwt-dev/bwt / block_on_future

Function block_on_future

src/util/mod.rs:134–140  ·  view source on GitHub ↗
(future: F)

Source from the content-addressed store, hash-verified

132/// Wait for the future to resolve, blocking the current thread until it does
133#[cfg(feature = "tokio")]
134pub 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.

Callers 1

startMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected