subspace_farmer::utils

Function run_future_in_dedicated_thread

source
pub fn run_future_in_dedicated_thread<CreateFut, Fut, T>(
    create_future: CreateFut,
    thread_name: String,
) -> Result<impl Future<Output = Result<T, Canceled>> + Send>
where CreateFut: FnOnce() -> Fut + Send + 'static, Fut: Future<Output = T> + 'static, T: Send + 'static,
Expand description

Runs future on a dedicated thread with the specified name, will block on drop until background thread with future is stopped too, ensuring nothing is left in memory