Template Struct sender¶
Defined in File execution.hpp
Struct Documentation¶
-
template<typename
S>
structsender¶ Concept that defines a sender.
A sender represents an asynchronous operation not yet scheduled for execution. A sender’s responsibility is to fulfill the receiver contract to a connected receiver by delivering a completion signal.
- Template Parameters
S: The type that is being checked to see if it’s a sender
A sender, once the asynchronous operation is started must successfully call exactly one of these on the associated receiver:
set_value() in the case of success
set_done() if the operation was canceled
set_error() if an exception occurred during the operation, or while calling set_value()
The sender starts working when
submit(S, R)orstart(connect(S, R))is called passing the sender and a receiver object in. The sender should not execute any other work after calling one of the three completion signals operations. The sender should not finish its work without calling one of these.A sender should expose a connect() customization-point object to connect it to a receiver. Also, typically there is submit() CPO for a sender, but this can be inferred from connect().
A sender typically exposes the type of the values it sets, and the type of errors it can generate, but this is not mandatory.