Skip to content

AsyncGenerator: implement await_transform in promise type#295

Merged
danvratil merged 1 commit intomainfrom
await-transform-in-async-generator
Dec 10, 2025
Merged

AsyncGenerator: implement await_transform in promise type#295
danvratil merged 1 commit intomainfrom
await-transform-in-async-generator

Conversation

@danvratil
Copy link
Collaborator

This allows directly co_awaiting various QCoro types without the use of the qCoro() wrapper in AsyncGenerator coroutines. We already have this behavior in QCoro::Task coroutines, so its confusing that auto *reply = co_await nam.get(...) would work in QCoro::Task but not in an AsyncGenerator.

Fixes #292.

This allows directly `co_await`ing various QCoro types without the use
of the `qCoro()` wrapper in AsyncGenerator coroutines. We already have
this behavior in `QCoro::Task` coroutines, so its confusing that
`auto *reply = co_await nam.get(...)` would work in QCoro::Task but not
in an AsyncGenerator.

Fixes #292.
@danvratil danvratil merged commit cbf2184 into main Dec 10, 2025
39 of 48 checks passed
@danvratil danvratil deleted the await-transform-in-async-generator branch December 10, 2025 09:58
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.

co_await reply doesn't work in AsyncGenerator

1 participant