[][src]Function tokio_safe_block_on::tokio_safe_block_forever_on

pub fn tokio_safe_block_forever_on<F>(f: F) -> Result<F::Output, BlockOnError> where
    F: 'static + Future + Send,
    <F as Future>::Output: Send

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. This version will never time out - you may end up binding a tokio background thread forever.