|
ecor
|
Keyed source that implements a scheduler that allows multiple receivers to be scheduled with the same completion signatures, and processes them in order based on a key provided at scheduling time. More...
#include <ecor.hpp>
Public Types | |
| using | sender_type = _sh_sender< K, S... > |
Public Member Functions | |
| bool | empty () const |
| Check if there are any scheduled receivers. More... | |
| _sh_entry< K, S... > const & | front () const |
| Get a reference to the scheduled receiver with the smallest key. More... | |
| _sh_sender< K, S... > | schedule (K key) noexcept(noexcept(_sh_sender< K, S... >{ key, _sh })) |
| Schedule a new sender with this scheduler, using the provided key for ordering. More... | |
| template<typename E1 > | |
| void | set_error (E1 &&err) |
| Send a set_error signal to the scheduled receiver with the smallest key. More... | |
| void | set_stopped () |
| Send a set_stopped signal to the scheduled receiver with the smallest key. More... | |
| template<typename... V> | |
| void | set_value (V &&... value) |
| Send a set_value signal to the scheduled receiver with the smallest key. More... | |
Keyed source that implements a scheduler that allows multiple receivers to be scheduled with the same completion signatures, and processes them in order based on a key provided at scheduling time.
The key is used to order the scheduled receivers in a heap, and completion signals are delivered to the receiver with the smallest key.
|
inline |
Check if there are any scheduled receivers.
This returns true if there are no scheduled receivers, and false otherwise.
|
inline |
Get a reference to the scheduled receiver with the smallest key.
This does not modify the heap, so the receiver remains scheduled and will receive the next completion signal sent to the source. The behavior is undefined if there are no scheduled receivers.
|
inlinenoexcept |
Schedule a new sender with this scheduler, using the provided key for ordering.
The sender is returned with the key and a reference to the heap of the scheduler, and when connected and started, it will be linked into the heap based on the key.
|
inline |
Send a set_error signal to the scheduled receiver with the smallest key.
The receiver is unregistered before the signal is sent, so it will only receive the first set_error signal sent after it is scheduled.
The error is perfectly forwarded.
|
inline |
Send a set_stopped signal to the scheduled receiver with the smallest key.
The receiver is unregistered before the signal is sent, so it will only receive the first set_stopped signal sent after it is scheduled.
|
inline |
Send a set_value signal to the scheduled receiver with the smallest key.
The receiver is unregistered before the signal is sent, so it will only receive the first set_value signal sent after it is scheduled.
Arguments are perfectly forwarded.