cplusplus / sender-receiver

Issues list for P2300
Apache License 2.0
20 stars 3 forks source link

generalize the `read` sender factory #54

Open ericniebler opened 10 months ago

ericniebler commented 10 months ago

Issue by ericniebler Tuesday Jul 19, 2022 at 22:24 GMT Originally opened as https://github.com/NVIDIA/stdexec/issues/538


read(cpo) is a sender that fetches the value of the query cpo from the receiver's environment and sends it through the value channel. Here are two ideas for making it more general:

See also #539, #540

ericniebler commented 10 months ago

Comment by miscco Wednesday Jul 20, 2022 at 06:24 GMT


That feels like a monadic interface. would value and value_or fit here?

ericniebler commented 10 months ago

Comment by ericniebler Saturday Aug 27, 2022 at 16:03 GMT


Maybe :

when_all(value(cpo1), value_or(cpo2, default))

?