[][src]Function blocking_permit::dispatch

pub fn dispatch<F>(f: F) -> Option<F> where
    F: FnOnce() + Send + 'static, 

Dispatch a blocking operation closure to a pool, if registered.

If a pool has been registered via register_dispatch_pool, then the closure is spawned on the pool and this returns None. Otherwise the original closure is returned.

Alternatively dispatch_rx may be used to await and obtain a return value from the closure.