-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add require_started
sender adaptor
#869
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cscs-ci run |
Performance test reportpika PerformanceComparison
Info
Explanation of Symbols
|
msimberg
force-pushed
the
require-started
branch
3 times, most recently
from
November 27, 2023 10:47
eb85c98
to
77ae5de
Compare
Performance test reportpika PerformanceComparison
Info
Explanation of Symbols
|
msimberg
force-pushed
the
require-started
branch
from
November 27, 2023 12:22
77ae5de
to
2ed172e
Compare
cscs-ci run |
cscs-ci run |
cscs-ci run |
1 similar comment
cscs-ci run |
msimberg
force-pushed
the
require-started
branch
from
December 4, 2023 11:13
2ed172e
to
0650423
Compare
cscs-ci run |
1 similar comment
cscs-ci run |
cscs-ci run |
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Dec 4, 2023
…because just() is not copy assignable
msimberg
force-pushed
the
require-started
branch
from
December 4, 2023 12:47
0650423
to
a26b322
Compare
cscs-ci run |
Performance test reportpika PerformanceComparison
Info
Explanation of Symbols
|
cscs-ci run |
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Dec 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #790.
Comments on the name are especially welcome. I found
require_started
quite descriptive as it signals that the user is required to make sure that the sender is started. It also mirrorsensure_started
which actually connects and starts a sender.The
require_started
sender has an empty state to make it somewhat sensible to detect unstarted senders. E.g.just()
is copyable, but it's also possible to connect it after moving it. This is not allowed by therequire_started
sender. Therequire_started
sender stores the wrapped sender internally in anoptional
, and when moving arequire_started
sender theoptional
is emptied.A
require_started
sender can be allowed to not be started, but it has to be explicitly asked for withdiscard
.When a
require_started
sender is not connected, or when it's connected but the operation state not started, the destructor will terminate (by default). Assigning to unstarted senders also leads to termination.Mainly for testing purposes the behaviour on unstarted senders is customizable. The default behaviour is to terminate, since that reports the error immediately and cannot be ignored. The behaviour can be changed to throw instead with a flag passed to the sender constructor, or changed afterwards with
set_mode
. I don't expect this second mode to be used much in practice, but it's useful to have as an alternative at least for testing. The choice of mode is disabled with stdexec, since stdexec requires nothrow destructible senders. In this caseterminate
is always used.