Function tokio_safe_for_aingle::tokio_safe[][src]

pub fn tokio_safe<F: Future>(
    f: F,
    timeout: Duration
) -> Result<F::Output, BlockOnError>

Provides the ability to execute async code from a sync context, without blocking a tokio core thread or busy looping the cpu. You must ensure you are within the context of a tokio::task, This allows tokio::task::block_in_place to move to a blocking thread.