[][src]Function tsukuyomi_server::rt::blocking

pub fn blocking<T>(
    op: impl FnOnce() -> T
) -> impl Future<Item = T, Error = BlockingError>

Creates a Future to execute the specified function that will block the current thread.

The future genereted by this function internally calls the Tokio's blocking API, and then enters a blocking section after other tasks are moved to another thread. See the documentation of tokio_threadpool::blocking for details.