atomgalaxy / review-executor-sendrecv

A board for reviewing the executors proposal P0440
1 stars 0 forks source link

[Question] Do we have concept for continuation #2

Closed tomaszkam closed 4 years ago

tomaszkam commented 4 years ago

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:

auto transformer = view::transform(f1) | view::transform(f2);
view::iota(10) | transformer;

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

tomaszkam commented 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.

tomaszkam commented 4 years ago

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);
  };