hyper/common/task.rs
1use std::task::{Context, Poll};
2
3/// A function to help "yield" a future, such that it is re-scheduled immediately.
4///
5/// Useful for spin counts, so a future doesn't hog too much time.
6pub(crate) fn yield_now(cx: &mut Context<'_>) -> Poll<std::convert::Infallible> {
7 cx.waker().wake_by_ref();
8 Poll::Pending
9}