feat(async): add retry_async over TimerQueue and deadline-domain conformance (M-TIME-03 B1b)
- NEW Async/Retry.hpp: retry_async drives RetryState with the TimerQueue's injected clock, awaits backoff via sleep_until, resumes only after a clean sleep (any sleep error ends the retry), preserves success after stop, supports Task-returning and move-only callables - Tests: AsyncRetry (15), DeadlineDomains blocking-retry manual-clock case Review: W11-REVIEW-B1b READY (deviation accepted; doc fix applied by root) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ce21be53a
commit
5c24f8e84f
5 files changed
+1555
-3
No files matched your search
@@ -50,8 +50,10 @@ MANDATORY semantics:
|
||||
`Coro::Task<std::expected<T,E>>` (co_await it). Success → return `T` (also when stop was requested
|
||||
during the attempt). Failure → `next(now, classify(error), stop_requested)`.
|
||||
- On `wait_until(at)`: `co_await timers.sleep_until(at, OperationOptions{options.stop, options.deadline})`.
|
||||
Then ALWAYS call `resume(now, options.stop.stop_requested())` — it re-checks stop itself, which covers
|
||||
the TimerQueue choice where a late stop yields `{}`. Sleep result mapping: `{}` → resume;
|
||||
After a `{}` sleep, ALWAYS call `resume(now, options.stop.stop_requested())` — it re-checks stop itself,
|
||||
which covers the TimerQueue choice where a late stop yields `{}`. Any sleep error ends the retry without
|
||||
calling `resume()` (amended after W11-REVIEW-B1b: resuming after `stopped`/`overloaded` would start
|
||||
attempts with no wait). Sleep result mapping: `{}` → resume;
|
||||
`cancelled` → stop with `stop_requested`; `timeout` → stop with `deadline_exceeded`; `stopped` (queue
|
||||
closed) → stop with `stop_requested` (documented: queue closure aborts the retry; no further attempt);
|
||||
`overloaded` → stop with `stop_requested` and document (no silent busy retry).
|
||||
|
||||
Reference in new issue
Block a user