Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BenFrantzDale opened this issue Oct 22, 2024 · 0 comments
Open

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

BenFrantzDale opened this issue Oct 22, 2024 · 0 comments
Labels
needs-proposed-resolution This issue does not yet have a proposed resolution but needs one

Comments

@BenFrantzDale
Copy link

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.

@ericniebler ericniebler added the needs-proposed-resolution This issue does not yet have a proposed resolution but needs one label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-proposed-resolution This issue does not yet have a proposed resolution but needs one
Projects
None yet
Development

No branches or pull requests

2 participants