Function safina_executor::schedule_blocking [−][src]
pub fn schedule_blocking<T: Send + 'static>(
f: impl FnOnce() -> T + Send + 'static
) -> Promise<T>
Schedules f
to run on any available thread in the blocking thread pool.
Returns immediately.
Await the returned promise to get the result of f
.
If f
panics, the promise will never complete.
Puts f
in a
Box
before adding it to the thread pool queue.
Panics
Panics if the caller is not running on an Executor
.