-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async IPC #307
Async IPC #307
Conversation
|
||
let inner = futures_util::stream::unfold(self, move |mut reader| async move { | ||
match reader.next().await { | ||
Ok(Some(array)) => Some((Ok(array.to_static()), reader)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This to_static
call is what allows us to use a regular futures::Stream instead of a LendingStream.
Honestly, I think I'd rather figure out buffer re-use and refactor ArrayView to not have borrowed values instead of switching over to LendingStream and losing out on the entire ecosystem e.g. StreamExt.
Implemented for both pure futures (e.g. Tokio) as well as MonoIO for IO-uring support.