Description
Based on reading e.g. the Tokio sources and knowledge passed down from async monks to novices, I assume that calling cx.waker().wake_by_ref()
from the task that is currently being polled will ensure that the task is polled again soon, even if no external reason arises. However, this behaviour is not documented, at least not unambiguously — the documentation for core::future::Future
only states that the waker provided by the context can be used to wake up the task, which may technically require the task to be “sleeping” for this to have an effect.
If there is consensus that wake_by_ref
will always and unconditionally ensure one further call to poll
, then we should document this expectation as part of the Future contract. Who agrees? Anyone against? Am I missing something?