mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_udp: glommio: add yield_if_needed(), add comment
This commit is contained in:
parent
93907822f8
commit
9dc615a8f9
2 changed files with 5 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
|
|||
use futures_lite::stream::empty;
|
||||
use futures_lite::StreamExt;
|
||||
use glommio::channels::channel_mesh::{MeshBuilder, Partial, Role};
|
||||
use glommio::prelude::*;
|
||||
use rand::prelude::SmallRng;
|
||||
use rand::SeedableRng;
|
||||
|
||||
|
|
@ -56,5 +57,7 @@ pub async fn run_request_worker(
|
|||
if let Err(err) = response_senders.try_send_to(producer_index, (response, addr)) {
|
||||
::log::warn!("response_sender.try_send: {:?}", err);
|
||||
}
|
||||
|
||||
yield_if_needed().await;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,9 +65,10 @@ async fn read_requests(
|
|||
) {
|
||||
let mut rng = StdRng::from_entropy();
|
||||
|
||||
let valid_until = ValidUntil::new(config.cleaning.max_connection_age);
|
||||
let access_list_mode = config.access_list.mode;
|
||||
|
||||
// Needs to be updated periodically: use timer?
|
||||
let valid_until = ValidUntil::new(config.cleaning.max_connection_age);
|
||||
// Needs to be updated periodically: use timer?
|
||||
let access_list = AccessList::default();
|
||||
// Needs to be cleaned periodically: use timer?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue