Linearise insertion into an output channel from a fixed number of producers by sequence number. More...
#include <lineariser.hpp>
Public Member Functions | |
| Lineariser (std::shared_ptr< Context > ctx, std::shared_ptr< Channel > ch_out, std::size_t num_producers, std::size_t buffer_size=1) | |
Create a new Lineariser into an output channel. More... | |
| std::vector< std::shared_ptr< BoundedQueue > > & | get_queues () |
| Get a reference to the input queues. More... | |
| Actor | drain () |
| Process inputs and send to the output channel. More... | |
| coro::task< void > | shutdown () |
| Shut down the lineariser, informing both producers and consumer/. More... | |
Linearise insertion into an output channel from a fixed number of producers by sequence number.
Producers are polled in round-robin fashion, and therefore must deliver messages in round-robin increasing sequence number order. If this guarantee is upheld, then the output of the Lineariser is guaranteed to be in total order of the sequence numbers.
Example usage:
Definition at line 50 of file lineariser.hpp.
|
inline |
Create a new Lineariser into an output channel.
| ctx | Streaming context. |
| ch_out | The output channel. |
| num_producers | The number of producers. |
| buffer_size | The number of messages that are buffered in the lineariser from each producer. |
Definition at line 61 of file lineariser.hpp.
|
inline |
Process inputs and send to the output channel.
coro::when_all with all of the producer tasks. Definition at line 94 of file lineariser.hpp.
|
inline |
Get a reference to the input queues.
BoundedQueues to send into.Definition at line 82 of file lineariser.hpp.
|
inline |
Shut down the lineariser, informing both producers and consumer/.
Definition at line 130 of file lineariser.hpp.