Skip to main content

handle_slow_future

Function handle_slow_future 

Source
pub async fn handle_slow_future<Fut, T, F>(
    future: Fut,
    slow_duration: Duration,
    callback: F,
) -> T
where Fut: Future<Output = T>, F: FnOnce(),
Expand description

Helper to run a callback when a future is taking longer than a slow_duration