Skip to content

Update when_all to operate on IoAwaitable#146

Merged
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:feature/when_all_awaitable
Feb 10, 2026
Merged

Update when_all to operate on IoAwaitable#146
mvandeberg merged 1 commit intocppalliance:developfrom
mvandeberg:feature/when_all_awaitable

Conversation

@mvandeberg
Copy link
Contributor

@mvandeberg mvandeberg commented Feb 10, 2026

Summary by CodeRabbit

  • Refactor
    • Updated when_all API to accept IoAwaitables directly instead of exclusively task types, enabling composition with a broader range of awaitable types.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

A detail-level type alias awaitable_result_t is added to extract awaitable result types via await_resume(). The when_all API is refactored from accepting task<Ts>... to accepting IoAwaitable... As, updating its public signature, internal state representation, and storage. The same type alias is removed from when_any to avoid duplication.

Changes

Cohort / File(s) Summary
Type Extraction Infrastructure
include/boost/capy/concept/io_awaitable.hpp
Adds detail-level type alias awaitable_result_t<A> that extracts result type by invoking await_resume() on a decayed awaitable reference.
when_all Awaitable Refactor
include/boost/capy/when_all.hpp
Refactors when_all API from task-centric to awaitable-centric: public function signature changes from when_all(task<Ts>... tasks) to when_all(As... awaitables) with IoAwaitable constraint; result type calculation updated to use awaitable_result_t<As>...; internal state storage, frame storage, launcher adapters, and dispatch flow all switched from task-based to awaitable-based; documentation and parameter descriptions updated accordingly.
Type Alias Deduplication
include/boost/capy/when_any.hpp
Removes detail-level awaitable_result_t type alias (now centralized in io_awaitable.hpp).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Feature: when_any #101: Directly related through shared use of awaitable_result_t and awaitable-based combinator APIs; implements when_any which previously defined the type alias now extracted to io_awaitable.hpp.

Poem

🐰 Awaitables hop in with grace,
Tasks yield to a better place,
Type aliases extracted, deduplicated clean,
When_all now sees what all have seen! ✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective: refactoring when_all to operate on IoAwaitable entities instead of task types, which is the primary change across all modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
include/boost/capy/when_all.hpp (1)

400-448: Consider documenting parent-cancellation propagation and @throws behavior.

The javadoc is well-written and covers concurrency, result ordering, and the first-exception-wins policy. Two gaps relative to the coding guidelines for async/awaitable function javadoc:

  1. Cancellation support: The launcher (line 310‑323) propagates the parent's stop_token to children, but the doc doesn't mention that callers can cancel when_all via a parent stop token (and that the resulting error compares equal to capy::cond::canceled).
  2. @throws: The function rethrows the first child exception (line 468‑469), which could be documented with a @throws clause.

As per coding guidelines: "Document cancellation support in async/awaitable function javadoc" and "Document @throws in async/awaitable function javadoc for precondition violations".


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cppalliance-bot
Copy link

An automated preview of the documentation is available at https://146.capy.prtest3.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-02-10 18:51:34 UTC

@cppalliance-bot
Copy link

GCOVR code coverage report https://146.capy.prtest3.cppalliance.org/gcovr/index.html
LCOV code coverage report https://146.capy.prtest3.cppalliance.org/genhtml/index.html
Coverage Diff Report https://146.capy.prtest3.cppalliance.org/diff-report/index.html

Build time: 2026-02-10 19:00:15 UTC

@mvandeberg mvandeberg merged commit b6130a0 into cppalliance:develop Feb 10, 2026
13 checks passed
@mvandeberg mvandeberg deleted the feature/when_all_awaitable branch February 10, 2026 19:03
@coderabbitai coderabbitai bot mentioned this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants