Skip to content

can let_value and split do same thing? #1204

Answered by maikel
fililili asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

this is a good question! The effect that you achieve for this particular example is very similar, but the algorithms split and let_value have different purposes.

split

The sender returned by ex::split(std::move(s1)) is always copyable and can be connected multiple times even after it has completed once. But the operation associated with s1 is only started once. If you visualize your senders as a graph, the split algorithm is literally a split that connects one parent node with multiple children. To achieve this, the current implementation

(i) creates a reusable shared state within the sender returned by split
(ii) stores the completion result in the shared state upon the completion of…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ericniebler
Comment options

You must be logged in to vote
6 replies
@villevoutilainen
Comment options

@villevoutilainen
Comment options

@maikel
Comment options

@fililili
Comment options

@maikel
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants