Defined in <stlab/concurrency/channel.hpp>
template <typename T>
class receiver

Implements the receiving part of a CSP channel

Each receiver has an attached process that gets executed when a value is send through the sender into the channel. This attached process must either be an n-ary function object - n depends on the number of attached upstream receiver - or it must be of a type that implements an await() and yield() method.

Multiple calls to operator| on the same object split the channel. That means that the result of this process is copied into all attached downstream channels.

The queue size of the attached process can be limited with a buffer_size.

If an exception is thrown while calling the attached process, the exception pointer is passed to the attached process, if it has a set_error() method, otherwise this process is closed.

All non-destructed receivers on a channel must be set_ready() or data cannot flow to any stream processes.

Member types

Member type Definition
value_type T

Member Functions

(constructor) Default-constructs a receiver
(destructor) Default-destructs a receiver

Attaches a new process to the channel.

Returns true if the receiver is ready, otherwise false.

Sets the receiver ready to receive values.

Associated Classes

Encapsulates the buffer size of a process

Executor wrapper class