add a yield_now just in case

This commit is contained in:
Bryan Stitt 2023-09-19 15:40:24 -07:00
parent 0437d9bfc9
commit 98da8cdfa7
3 changed files with 5 additions and 2 deletions

2
Cargo.lock generated

@ -1298,7 +1298,7 @@ dependencies = [
[[package]]
name = "deduped_broadcast"
version = "0.2.0"
version = "0.2.1"
dependencies = [
"lru",
"serde",

@ -1,6 +1,6 @@
[package]
name = "deduped_broadcast"
version = "0.2.0"
version = "0.2.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -8,6 +8,7 @@ use std::{
hash::{Hash, Hasher},
};
use tokio::sync::{broadcast, mpsc};
use tokio::task::yield_now;
struct DedupedBroadcasterTask<T>
where
@ -58,6 +59,8 @@ where
self.total_broadcasts.fetch_add(x, Ordering::Relaxed);
}
});
yield_now().await;
}
}
}