Function bastion::executor::blocking [−][src]
pub fn blocking<F, R>(future: F) -> RecoverableHandle<R> where
F: Future<Output = R> + Send + 'static,
R: Send + 'static,
Expand description
Spawns a blocking task, which will run on the blocking thread pool, and returns the handle.
Example
use bastion::executor::blocking;
let task = blocking(async move {
thread::sleep(time::Duration::from_millis(3000));
});