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
I no longer think the benefits of having Notify as a separate trait are worth the trade-off, since in practice, most Notifys have a point where they could end. Additionally, when using pasts I have found the need for what is essentially a lending async iterator (for updates to the wavy crate - currently wavy uses unsafe code to "get around" this limitation).
Since AsyncIterator is not stable in std yet, this will have to be redefined in pasts, with a compatibility feature that will currently depend on nightly, and one for Stream compatibility.
pubtraitAsyncIterator{typeItem<'a>;fnpoll_next<'a>(self:Pin<&mutSelf>,cx:&mutContext<'_>) -> Poll<Option<Self::Item<'a>>>;// Return type should be switched out for public type with private constructor// // Choosing to take as `Pin` to allow `.next()` to be called in more places,// although often more verbose than requiring `Unpin` (may also add `next_unpinned()`)fnnext<'a>(mutself:Pin<&mutSelf>) -> implFuture<Output = Option<Self::Item<'a>>> + '_ {
std::future::poll_fn(move |cx| self.as_mut().poll_next(cx))}}
Rather than treating an async iterator as a stream, and having another sink type, those concepts build on what an async iterator is (similar to wavy's current design, returning fon's streams and sinks on Ready). I'll add an example later.
The text was updated successfully, but these errors were encountered:
I no longer think the benefits of having
Notify
as a separate trait are worth the trade-off, since in practice, mostNotify
s have a point where they could end. Additionally, when using pasts I have found the need for what is essentially a lending async iterator (for updates to the wavy crate - currently wavy uses unsafe code to "get around" this limitation).Since
AsyncIterator
is not stable instd
yet, this will have to be redefined in pasts, with a compatibility feature that will currently depend on nightly, and one forStream
compatibility.https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=775ff0afbe5e28a0e48403b9145dcef6
Rather than treating an async iterator as a stream, and having another sink type, those concepts build on what an async iterator is (similar to wavy's current design, returning fon's streams and sinks on
Ready
). I'll add an example later.The text was updated successfully, but these errors were encountered: