pub async fn with_slow_future_monitor<F, C>(
future: F,
threshold: Duration,
callback: C,
) -> F::Output
Expand description
Wraps a future with slow/stuck detection using tokio::select!
This implementation races the future against a timer. If the timer expires first, the callback is executed (exactly once) but the future continues to run. This approach can detect stuck futures that never wake their waker.