Implement HPX Future-Sender Bridge (P2300 interoperability)#7256
Implement HPX Future-Sender Bridge (P2300 interoperability)#7256shivansh023023 wants to merge 1 commit intoTheHPXProject:masterfrom
Conversation
Up to standards ✅🟢 Issues
|
|
Can one of the admins verify this patch? |
|
@shivansh023023 What's the difference to the existing |
|
Thank you for pointing this out, @hkaiser I wasn't aware of the existing I've now reviewed those headers. Given that the core functionality already
I'd appreciate your guidance on which direction is most useful. I'm |
If that improves the integration, sure, please do that.
If tests are missing this is also a nice addition.
That's what I was asking. What would this PR add on top of what's already in place? |
Implement
hpx::future↔ P2300 Sender Interoperability BridgeFixes #5219
Proposed Changes
libs/core/futures/include/hpx/futures/future_sender.hpp: implementsfuture_sender<T>, a P2300-compliant sender that wrapshpx::future<T>,exposing
as_sender(hpx::future<T>&&)as the public API entry pointlibs/core/futures/include/hpx/futures/sender_future.hpp: implementsas_future(sender)which converts any P2300 sender into anhpx::future<T>using an internal
sender_future_receiverthat bridges the two completionchannels
libs/core/futures/tests/unit/future_sender_test.cpp: unit testscovering future→sender conversion, sender→future conversion, error
propagation through the error channel, and move-only semantics verification
libs/core/futures/tests/unit/CMakeLists.txtfollowing the existing alphabetical ordering convention
Any background context you want to provide?
HPX currently has two async worlds that cannot communicate natively:
hpx::async()returnshpx::future<T>(HPX's own type)stdexeclibraryThis PR builds the translator layer between them, so that existing HPX
code producing futures can be seamlessly composed into modern P2300 pipelines,
and vice versa:
This is a foundational step toward the broader goal of re-implementing the
executor API on top of the sender/receiver infrastructure (issue #5219), as
it allows
hpx::async,hpx::dataflow, and other future-returning facilitiesto be gradually migrated into P2300 pipelines without breaking existing user
code.
Implementation follows all established HPX bridge conventions:
sender_concept/receiver_concepttags forstdexecconcept compliancetag_invokecustomization points (no virtual dispatch)HPX_CXX_CORE_EXPORTannotations for C++20 Module BMI visibilityfuturesandexecutorsmodulesChecklist