Skip to main content

task_sync

Function task_sync 

Source
pub fn task_sync<T: Send, F: Future<Output = T> + Send>(future: F) -> T
Expand description

Trampoline function for calling the async api in a sync way.

This convoluted mess was implemented because doing oneshot::spawn directly on the async api functions resulted in a memory leak in tokio_threadpool. Spawning the future indirectly appears to work without memory leak.