ws: don't yield unnecessarily in run_in_message_loop, improve logging

This commit is contained in:
Joakim Frostegård 2024-01-05 23:13:31 +01:00
parent d48deeff8c
commit 579fcb2140
2 changed files with 7 additions and 9 deletions

View file

@ -20,7 +20,7 @@ use futures_rustls::TlsAcceptor;
use glommio::channels::channel_mesh::Senders;
use glommio::channels::local_channel::{LocalReceiver, LocalSender};
use glommio::net::TcpStream;
use glommio::timer::{sleep, timeout};
use glommio::timer::timeout;
use glommio::{enclose, prelude::*};
use hashbrown::hash_map::Entry;
use hashbrown::HashMap;
@ -214,12 +214,6 @@ struct ConnectionReader<S> {
impl<S: futures::AsyncRead + futures::AsyncWrite + Unpin> ConnectionReader<S> {
async fn run_in_message_loop(&mut self) -> anyhow::Result<()> {
loop {
while self.out_message_sender.is_full() {
sleep(Duration::from_millis(100)).await;
yield_if_needed().await;
}
let message = self
.ws_in
.next()