Try to force new thread for msg counter to ensure it has time to print

This commit is contained in:
James Wilson committed 2021-08-12 16:01:09 +01:00
1 parent b97aec99a8
commit 968dd2b957
1 file changed
+9 -7
@@ -196,13 +196,15 @@ impl InnerLoop {
// TEMP: let's monitor message queue len out of interest
let tx_len = metered_tx.clone();
tokio::spawn(async move {
let mut n = 0;
loop {
println!("#{} Queue len: {}", n, tx_len.len());
n += 1;
tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
}
std::thread::spawn(move || {
tokio::runtime::Runtime::new().unwrap().block_on(async move {
let mut n = 0;
loop {
println!("#{} Queue len: {}", n, tx_len.len());
n += 1;
tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
}
});
});
while let Some(msg) = rx_from_external.next().await {