async: add stdexec coroutine primitives + gRPC coroutine reply path#323
Merged
Conversation
Phase 0 of the stack-wide folly/std::future -> exec::task migration. All additive (existing std::future paths untouched), so consumers can adopt incrementally. - async/value_awaitable.hpp: cross-thread single-shot awaitable carrying T (generalizes cqe_awaitable from int->T). Producer complete(T) from any thread, consumer co_awaits; same lock-free init/waiting/done acq_rel handshake that restores folly::Future's cross-thread happens-before. - async/task.hpp: `using task = exec::task<T>` currency alias (opt-in header; needs stdexec). - async/when_all.hpp: dynamic (runtime-vector) fan-out when_all(vector<task<T>>) -> task<vector<T>>. Counting latch on value_awaitable; errors-as-values, never short-circuits (broadcast semantics ignore per-peer errors). T must be default-constructible. - grpc/rpc_client: GenericRpcDataCoroBlob + GenericAsyncStub::call_unary_co deliver a coroutine reply ALONGSIDE the std::future one (value_awaitable.complete fires from the gRPC CQ worker thread). Stays stdexec-free; when_all composition lives a layer up at nuraft_mesg. Test: test_value_awaitable (8/8, incl 2000-iter cross-thread handshake, registered unconditionally -- no stdexec needed).
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.
using task = exec::task<T>currency alias (opt-in header; needs stdexec).