Closed tomaszkam closed 4 years ago
I am looking for something that could be passed to indexed_for
from P1979, to perform asynchrous work, i.e.:
auto http_connect = ...; // continuation
just(std::vector<uri>{...}) |
indexed_for(...., http_connect);
I.e. call sender/receiver compatible algorithm for each element of a sequence, possibly in parallel.
I have realized I was to much focused on I
syntax, what I am looking for is jsut async algorithm, that takes a sender and returns sender:
auto transformer = [](auto sender) {
return sender | transform(f1) | transform(f2);
};
From what I have read in the paper, we currently have a way to build senders from senders, e.g.:
just(10) | transform(f1) | transform(f2)
Which, would be equivalent in ranges word to:view::iota(10) | view::transform(f1) | view::transform(f2)
However, I would like to have ability to build a pipeline/continuation, i.e. the:
auto transformer = transform(f1) | transform(f2)
; And then apply it for sender, eg:just(10) | transformer
Like I can do with ranges:That the something, I in my head works like a continuation, i.e. propagates
set_value
,set_error
,set_done
method with modification. And:sender
+continuation
=sender
continuation
+continuation
=continuation
continuation
+receiver
=receiver