diff options
author | François Laignel <fengalin@free.fr> | 2022-09-01 18:54:05 +0300 |
---|---|---|
committer | Sebastian Dröge <slomo@coaxion.net> | 2022-09-13 10:29:50 +0300 |
commit | 61c62ee1e85d48578a11e4e84366885fcd0fe4ac (patch) | |
tree | f1913e624e16e2553daf4186d9cd4f665db53ded /generic/threadshare/src/jitterbuffer | |
parent | 235ded35fd71082ac9ec78502ba462adb238d38f (diff) |
ts/timers: multiple improvements
This commit improves threadshare timers predictability
by better making use of current time slice.
Added a dedicate timer BTreeMap for after timers (those
that are guaranteed to fire no sooner than the expected
instant) so as to avoid previous workaround which added
half the max throttling duration. These timers can now
be checked against the reactor processing instant.
Oneshot timers only need to be polled as `Future`s when
intervals are `Stream`s. This also reduces the size for
oneshot timers and make user call `next` on intervals.
Intervals can also implement `FusedStream`, which can help
when used in features such as `select!`.
Also drop the `time` module, which was kepts for
compatibility when the `executor` was migrated from tokio
based to smol-like.
Diffstat (limited to 'generic/threadshare/src/jitterbuffer')
-rw-r--r-- | generic/threadshare/src/jitterbuffer/imp.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index 3499e8912..ded2413c8 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -1125,7 +1125,7 @@ impl TaskImpl for JitterBufferTask { let (delay_fut, abort_handle) = abortable(async move { match next_wakeup { Some((_, delay)) => { - runtime::time::delay_for_at_least(delay).await; + runtime::timer::delay_for_at_least(delay).await; } None => { future::pending::<()>().await; |