Timer, Custom Clock/WaitTraits - #333
Conversation
Add a delay overload accepting a time point on any clock, with a
wait-traits policy controlling how much of the remaining time each
underlying steady wait may cover:
co_await delay(system_clock::now() + 5min);
co_await delay<capped_traits>(deadline);
The wait is zero-alloc: a sequence of re-armed steady-clock waits on
one frame-embedded waiter. waiter_node gains a re-arm hook consulted
by the completion op before resuming, and clock_delay_awaitable
re-publishes its waiter with the next traits-capped expiry until
Clock::now() reaches the deadline. Publication goes through a new
timer::publish_wait entry point with no elapsed fast path, so every
completion (including cancellation) reaches the hook; re-arms go
through timer::rearm_wait, which preserves the wait's work count and
stop callback. Steady-clock time points, of any duration type, keep
routing to the existing single-wait awaitable.
The new public header wait_traits.hpp provides the identity default
traits and the WaitTraits concept. The timers guide gains a section
on delaying against a different clock.
|
An automated preview of the documentation is available at https://333.corosio.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-08-06 12:38:57 UTC |
|
GCOVR code coverage report https://333.corosio.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-08-06 12:54:52 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #333 +/- ##
===========================================
- Coverage 79.97% 79.81% -0.16%
===========================================
Files 96 96
Lines 6012 5946 -66
Branches 1234 1213 -21
===========================================
- Hits 4808 4746 -62
+ Misses 856 852 -4
Partials 348 348
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
No description provided.