1
0
Fork 0
forked from wry/wry

async: rebase wheel on top of async engine

This commit is contained in:
Julian Orth 2022-05-12 17:23:17 +02:00
parent 87a90a8ae4
commit 3875c63172
13 changed files with 218 additions and 285 deletions

View file

@ -23,9 +23,8 @@ pub async fn client(data: Rc<Client>) {
}
drop(recv);
data.flush_request.trigger();
match data.state.eng.timeout(5000) {
Ok(timeout) => {
timeout.await;
match data.state.wheel.timeout(5000).await {
Ok(_) => {
log::error!("Could not shut down client {} within 5 seconds", data.id.0);
}
Err(e) => {
@ -101,7 +100,7 @@ async fn receive(data: Rc<Client>) {
async fn send(data: Rc<Client>) {
let send = async {
let mut out = BufFdOut::new(data.socket.clone());
let mut out = BufFdOut::new(data.socket.clone(), &data.state.wheel);
let mut buffers = VecDeque::new();
loop {
data.flush_request.triggered().await;