smol-rs / futures-lite

Futures, streams, and async I/O combinators.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add now_or_never

dvc94ch opened this issue · comments

this has stopped me from using futures-lite a couple of times now. incredibly useful function.

It currently exists as futures_lite::future::poll_once, although it's not a method like .now_or_never().

No, that's not the same. It requires you to construct a waker, and if you look at the futures NoopWaker it's about 200loc.

Oh, sorry, I didn't realize. But it can still be useful when you are already in an async context, which is often the case.