pub fn run<F, I>(f: F) -> CpuFuture<I>
where
    F: FnOnce() -> I + Send + 'static,
    I: Send + 'static,
{
    let (tx, rx) = oneshot::channel();
    POOL.with(|pool| {
        pool.execute(move || {
            if !tx.is_canceled() {
                let _ = tx.send(f());
            }
        })
    });

    CpuFuture { rx }
}
/// Execute blocking function on a thread pool, returns future that resolves
/// to result of the function execution.
Execute blocking function on a thread pool, returns future that resolves
to result of the function execution.
Execute blocking function on a thread pool returns future that resolves to result of the function execution .
pub fn run<F, I>(f: F) -> CpuFuture<I>
where
    F: FnOnce() -> I + Send + 'static,
    I: Send + 'static,
{
    let (tx, rx) = oneshot::channel();
    POOL.with(|pool| {
        pool.execute(move || {
            if !tx.is_canceled() {
                let _ = tx.send(f());
            }
        })
    });
    CpuFuture { rx }
}
pub fn run < F , I > ( f : F ) -> CpuFuture < I > where F : FnOnce ( ) -> I + Send + ' static , I : Send + ' static , { let ( tx , rx ) = oneshot :: channel ( ) ; POOL . with ( | pool | { pool . execute ( move | | { if ! tx . is_canceled ( ) { let _ = tx . send ( f ( ) ) ; } } ) } ) ; CpuFuture { rx } }
Execute blocking function on a thread pool, returns future that resolves
to result of the function execution.
Execute blocking function on a thread pool returns future that resolves to result of the function execution .
f
F