Function tokio_safe_for_aingle::tokio_safe_block_forever_on [−][src]
pub fn tokio_safe_block_forever_on<F: Future>(f: F) -> F::Output
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.