You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
None of our poll_* functions actually take a cx: &mut std::task::Context, which is the standardized interface for futures in Rust. Instead, applications are expected to call conn.set_waker(cx.waker()) before calling poll_*.
Solution:
We should, instead, double down on async, and require std::task::Context to be passed to all functions that have the signature fn poll_*(&mut self, cx: &mut std::task::Context) -> Poll<Result<_>>;. For blocking IO applications, it's very trivial to make no-op wakers, especially with the coming Waker::noop method in std (see rust-lang/rust#98286). We can also add blocking APIs that construct noop wakers, if this is too painful as well.
The text was updated successfully, but these errors were encountered:
Problem:
None of our
poll_*
functions actually take acx: &mut std::task::Context
, which is the standardized interface for futures in Rust. Instead, applications are expected to callconn.set_waker(cx.waker())
before callingpoll_*
.Solution:
We should, instead, double down on async, and require
std::task::Context
to be passed to all functions that have the signaturefn poll_*(&mut self, cx: &mut std::task::Context) -> Poll<Result<_>>;
. For blocking IO applications, it's very trivial to make no-op wakers, especially with the comingWaker::noop
method instd
(see rust-lang/rust#98286). We can also add blocking APIs that construct noop wakers, if this is too painful as well.The text was updated successfully, but these errors were encountered: