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

add impl Sink for WebSocketConnection #9

Closed
wants to merge 1 commit into from
Closed

add impl Sink for WebSocketConnection #9

wants to merge 1 commit into from

Conversation

mcgoo
Copy link

@mcgoo mcgoo commented Jan 17, 2021

I couldn't get futures::select!() to work until I added impl Sink for WebSocketConnection. Without it, I could not work out how to send messages on the stream after fusing it.

@yoshuawuyts
Copy link
Member

yoshuawuyts commented Jan 17, 2021

Hi there, thanks for opening this PR. Unfortunately this is a duplicate of an earlier, closed PR: #3. Not implementing Sink has been a deliberate choice in the http-rs ecosystem. We don't think it's likely this trait will ever make it to the stdlib.

If you want to run multiple futures to completion in parallel, check out async-std's Future::{join,race} methods, and Stream::merge.

@mcgoo
Copy link
Author

mcgoo commented Jan 17, 2021

Got it. Thanks for the pointers, Stream::merge looks like the right thing for what I'm trying to do.

(It'll be nice to avoid futures::select!() if possible - it's powerful and useful but it annoys me a little to write core pieces of an app in almost-rust inside a macro.)

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

Successfully merging this pull request may close these issues.

2 participants