Skip to content

Allow awaiting val Promises in other coroutines #26064

@stevenwdv

Description

@stevenwdv

Currently, val::awaiter requires that the enclosing coroutine is also a val. It requires this because it communicates rejections directly to the val::promise_type, without the need for exceptions (this does lead to a bug though: #25396).

However, I would find it very useful to be able to await vals in other coroutine types, to await async JS functions in asynchronous C++ code using some other asynchronous library offering coroutines. I don't know if this could be made to work without exceptions enabled, so maybe make it conditional on that? See also related #25396 (comment).

Emscripten version: 4.0.22 (0f3d2e6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions