From: Ian Jackson Date: Wed, 4 Aug 2021 22:30:05 +0000 (+0100) Subject: enforce tx queue expiry X-Git-Tag: hippotat/1.0.0~333 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=55b968aa1d70955ad593a83bde24b01bce5db747;p=hippotat.git enforce tx queue expiry Signed-off-by: Ian Jackson --- diff --git a/src/bin/client.rs b/src/bin/client.rs index a1cdce4..d82496e 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -230,6 +230,15 @@ async fn run_client( let () = y.context("write rx data to ipif")?; }, + () = async { + let expires = tx_queue.front().unwrap().expires; + tokio::time::sleep_until(expires).await + }, + if ! tx_queue.is_empty() => + { + let _ = tx_queue.pop_front(); + }, + data = tx_stream.next_segment(), if tx_queue.is_empty() => {