From 98da8cdfa7ec0572aec3d7378c40fe94cc6c3469 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 19 Sep 2023 15:40:24 -0700 Subject: [PATCH] add a yield_now just in case --- Cargo.lock | 2 +- deduped_broadcast/Cargo.toml | 2 +- deduped_broadcast/src/lib.rs | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 022e7c66..fdd5c578 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1298,7 +1298,7 @@ dependencies = [ [[package]] name = "deduped_broadcast" -version = "0.2.0" +version = "0.2.1" dependencies = [ "lru", "serde", diff --git a/deduped_broadcast/Cargo.toml b/deduped_broadcast/Cargo.toml index f6e79115..18e2c01f 100644 --- a/deduped_broadcast/Cargo.toml +++ b/deduped_broadcast/Cargo.toml @@ -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 diff --git a/deduped_broadcast/src/lib.rs b/deduped_broadcast/src/lib.rs index 29936ca0..1ff058ba 100644 --- a/deduped_broadcast/src/lib.rs +++ b/deduped_broadcast/src/lib.rs @@ -8,6 +8,7 @@ use std::{ hash::{Hash, Hasher}, }; use tokio::sync::{broadcast, mpsc}; +use tokio::task::yield_now; struct DedupedBroadcasterTask where @@ -58,6 +59,8 @@ where self.total_broadcasts.fetch_add(x, Ordering::Relaxed); } }); + + yield_now().await; } } }