Skip to main content

install

Function install 

Source
pub fn install<F, R>(op: F) -> R
where F: FnOnce() -> R + Send, R: Send,
Expand description

Execute a closure in the global thread pool.

ยงExample

use ocas_core::thread_pool::install;

let result = install(|| 21 + 21);
assert_eq!(result, 42);