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

Implement AsyncWrite and AsyncRead for WebRtcChannel #453

Open
th4s opened this issue Jul 2, 2024 · 1 comment
Open

Implement AsyncWrite and AsyncRead for WebRtcChannel #453

th4s opened this issue Jul 2, 2024 · 1 comment

Comments

@th4s
Copy link

th4s commented Jul 2, 2024

My understanding is that currently WebRtcChannel supports sync but non-blocking API. It would be cool to have full AsyncRead and AsyncWrite support. It is already possible to take a channel from the socket with WebRtcSocket::take_channel.

What about having a

impl WebRtcChannel {
    pub fn into_async_raw(self) -> impl AsyncRead + AsyncWrite {
        // ...
    }
}

Is something like this possible? The UnboundedSender/UnboundedReceiver already implement Sink/Stream for (PeerId, Box<[u8]>) which could be leveraged for such an implementation.

@Craig-Macomber
Copy link

Since your PR didn't get linked here, its at: #461

I don't require async for my use-case, but I do need a way to do back-pressure so I can throttle updates when the network can't keep up. I suspect the ability to do async writes would work well for this, so I am interested in this feature.

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

2 participants