Skip to content

sync_wait should work with just_stopped() and just_error(e). #299

Open
@BenFrantzDale

Description

@BenFrantzDale

I mentioned this her but got no replies: https://lists.isocpp.org/std-proposals/2024/10/11308.php

The design options are:

  1. Either have unstoppable senders result in no optionality in the result.
  2. Consider having a lack of value result correspond to std::variant<> or some other untreatable type.

In as much as sync_wait is intended(?) to be beginner-friendly, I lean toward sync_wait(just_stopped()) -> std::optional<std::tuple<>> (ideally noexcept) since it’s what a beginner would expect. Alternatively, it could return std::optional<std::variant<>> reflecting that it can only be stopped.

Likewise I could see a fully-pedantic approach, so sync_wait(just()) -> std::tuple<> (noexcept?) since it can only succeed.

Regardless, sync_wait(just_stopped()) or more realistically sync_wait(repeat_until_ctrl_c(event_loop_sender)) should at least work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-proposed-resolutionThis issue does not yet have a proposed resolution but needs one

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions