Repository navigation
update the start scheduler before connecting scheduler sender in continues_on - #2277
ericniebler wants to merge 2 commits into
Conversation
c79da61 to
cd3d86b
Compare
| template <class _Env> | ||
| using __env2_t = __secondary_env_t<_Sender, _Env, set_value_t>; | ||
|
|
||
| template <class _Env> | ||
| constexpr auto __mk_env2(_Env&& __env) const noexcept -> __env2_t<_Env> | ||
| { | ||
| return __mk_secondary_env_t<set_value_t>()(__sndr_, static_cast<_Env&&>(__env)); | ||
| } |
There was a problem hiding this comment.
Noting that the tag is hardcoded here to set_value_t, whereas the call sites are templated on _SetTag? Could this lead to issues e.g. when the predecessor completes with error/stop?
There was a problem hiding this comment.
I think this issue is still open and may be relevant.
The __complete lambda stores all completions with their tag, along with a comment that states that the goal is to forward them from within the scheduler's context.
This is indeed what __receiver2 does:
If the predecessor completes with an error, we can thus expect that error to be re-emitted from the scheduler's context, and it seems that's a case that the queries don't capture yet.
Incidentally, the first sentence of the docstring of __receiver2 appears too strong because its set_error and set_stopped would be invoked from the predecessor's context.
| auto sndr = ex::schedule(pool.get_scheduler()) // | ||
| | ::then_store_thread_id(pool_tid) // | ||
| | ex::let_value( | ||
| [&]() noexcept |
There was a problem hiding this comment.
Just curious why you added noexcept?
|
/ok to test d5e63d7 |
|
/ok to test 4c50519 |
|
/ok to test 3e2bddf |
|
/ok to test 660d14d |
660d14d to
233768b
Compare
Co-authored-by: Maarten Arnst <maarten.arnst@ulg.ac.be>
|
/ok to test c127035 |
…2294) * fix(exec): make write_env transparent to sequence sender semantics A write_env sender wrapping a sequence sender was not itself a sequence sender: get_item_types has no branch that looks through stdexec sender adaptors, so sequence-aware algorithms like exec::transform_each treated the wrapper as a sequence of one and collapsed the item types. Make write_env senders transparent to sequence semantics: - specialize enable_sequence_sender for __write_env_t sexprs - compute item types of a write_env sender from its child in the joined environment (recursing through stacked wrappers) - subscribe to the child through a receiver that joins the written environment with the wrapped receiver's environment First half of #2053. The starts_on half goes through the continues_on machinery that #2277 is reworking, so it is left for a follow-up. * fix(exec): make sequence-adaptor transparency an open customization point Review feedback on #2294: get_item_types and subscribe must not hard-code individual sender adaptors, since the set of adaptors is open. Replace the write_env-specific branches with a generic mechanism driven by a new __sequence_adaptor_traits customization point: an adaptor that forwards set_next and all completions to a single child declares itself transparent for its tag, optionally naming the environment its child observes. write_env now only specializes that trait, and the sequence machinery handles every transparent adaptor the same way. The enable_sequence_sender specialization also goes through tag_of_t rather than digging into the sender's descriptor. Also merge upstream/main, and extend the regression tests with a user-defined adaptor that opts in via the new trait, to show that the extension point is open. * test: fix clang-format-21 violations in test_write_env_sequence.cpp Empty struct bodies written as `{ };` fail the style CI job, which runs clang-format-21 --dry-run --Werror over all tracked sources. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com> --------- Co-authored-by: alwaysprince05 <alwaysprince05@users.noreply.github.com> Co-authored-by: Codebuff <noreply@codebuff.com>
fixes #2268