Implement P2300 stopped_as_optional sender adapter#7243
Open
shivansh023023 wants to merge 1 commit intoTheHPXProject:masterfrom
Open
Implement P2300 stopped_as_optional sender adapter#7243shivansh023023 wants to merge 1 commit intoTheHPXProject:masterfrom
shivansh023023 wants to merge 1 commit intoTheHPXProject:masterfrom
Conversation
- Added stopped_as_optional to transform stopped signals into value(nullopt) - Implemented sender, receiver, and operation state for the transformation - Provided support for piping syntax via partial_algorithm - Forwarded environment and completion scheduler from predecessor - Added comprehensive unit tests for value, error, and stopped paths
Up to standards ✅🟢 Issues
|
Collaborator
|
Can one of the admins verify this patch? |
This file contains hidden or 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
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.
Implement P2300
stopped_as_optionalsender adapterDescription
This PR implements the
stopped_as_optionalsender adapter as defined in the P2300 (Sender/Receiver) standard. This utility is crucial for handling pipeline cancellations gracefully by converting a "stopped" signal into a successful "value" signal containing astd::nullopt.Technical Implementation:
Tintostd::optional<T>.set_value(std::nullopt).sends_stopped = falsesince the stopped signal is consumed by the adapter.get_envforwarding to ensure context and completion schedulers are preserved across the pipeline.|) operator viapartial_algorithm.Fixes #
Proposed Changes
libs/core/execution/include/hpx/execution/algorithms/stopped_as_optional.hpp.libs/core/execution/tests/unit/algorithm_stopped_as_optional.cppcovering value, error, and stopped scenarios.libs/core/execution/tests/unit/CMakeLists.txt.Background context
Currently, HPX's P2300 implementation requires manual handling of stopped signals which can lead to complex and verbose pipeline logic. Adding
stopped_as_optionalprovides a standardized, ergonomic way to treat cancellation as a state rather than a control-flow break.Checklist
inspecttool compliance.