An executor is a loop:
loop {
match future.as_mut().poll(&mut cx) {
Poll::Ready(v) => return v,
Poll::Pending => /* wait until woken */,
}
}
The only hard part is "wait until woken". Spinning would work and would burn a core. Instead the executor supplies a Waker in the Context, then parks the thread — and the future's job is to call that waker when progress becomes possible.
