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

webrtc: Optimize substream AsyncRead and AsyncWrite #351

Open
Tracked by #312
lexnv opened this issue Feb 27, 2025 · 0 comments
Open
Tracked by #312

webrtc: Optimize substream AsyncRead and AsyncWrite #351

lexnv opened this issue Feb 27, 2025 · 0 comments
Labels
priority: low Nice-to-have improvements, optimizations, or future considerations todo Extracted from code todos

Comments

@lexnv
Copy link
Collaborator

lexnv commented Feb 27, 2025

impl tokio::io::AsyncWrite for Substream {
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, std::io::Error>> {
if let State::SendClosed = *self.state.lock() {
return Poll::Ready(Err(std::io::ErrorKind::BrokenPipe.into()));
}
// TODO: try to coalesce multiple calls to `poll_write()` into single `Event::Message`

@lexnv lexnv added priority: low Nice-to-have improvements, optimizations, or future considerations todo Extracted from code todos labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Nice-to-have improvements, optimizations, or future considerations todo Extracted from code todos
Projects
None yet
Development

No branches or pull requests

1 participant