Template Struct sender

Struct Documentation

template<typename S>
struct sender

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:

The sender starts working when submit(S, R) or start(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.

See

receiver, receiver_of, typed_sender, sender_to