Skip to content
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

Cannot select on DuplexStream #13788

Closed
polyfractal opened this issue Apr 26, 2014 · 3 comments
Closed

Cannot select on DuplexStream #13788

polyfractal opened this issue Apr 26, 2014 · 3 comments

Comments

@polyfractal
Copy link

It appears impossible to select over a DuplexStream channel. Select's handle method only accepts Receivers, and there is no way to access the Receiver channel in a DuplexStream either.

I'd be happy to put in a PR, but I'm unsure the best course of action. One of these needs to be done:

  • Add a getter to obtain the DuplexStream's Receiver
  • Make the DuplexStream struct members public

And then there is a question how the user interacts with Select. Should there be:

  • Add a new handle method which accepts DuplexStreams (handle_duplex?)
  • Make the existing handle more generic and check type at runtime (seems like a bad idea)
  • Don't change anything, make the user pass in the DuplexStream's Receiver by hand
@thehydroimpulse
Copy link
Contributor

/cc me

@thestinger
Copy link
Contributor

This will all end up being thrown out as part of redesigning I/O and concurrency in the standard libraries. There's no reason to only support selection on channels rather than selection on both data structures and directly on IO operations / signals / timers.

@steveklabnik
Copy link
Member

DuplexStream is gone, partially for this reason, if I recall.

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 15, 2024
This addresses rust-lang#13099 for the manual_async_fn test.

changelog: [manual_async_fn]: Updated manual_async_fn to use
multipart_suggestions where appropriate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants