This commit is contained in:
asonix 2024-01-07 10:09:06 -06:00
parent 65e165af49
commit 9ceb26bb5c
2 changed files with 2 additions and 2 deletions

View File

@ -452,7 +452,7 @@ where
loop { loop {
tracing::trace!("heartbeat: looping"); tracing::trace!("heartbeat: looping");
count += 1; count += 1;
count = count % yield_limit; count %= yield_limit;
// yield every 8 iterations to be kind to other tasks // yield every 8 iterations to be kind to other tasks
if count == 0 { if count == 0 {

View File

@ -83,7 +83,7 @@ where
tracing::trace!("from_iterator: looping"); tracing::trace!("from_iterator: looping");
count += 1; count += 1;
count = count % yield_count; count %= yield_count;
yielder.yield_(res).await; yielder.yield_(res).await;