MT Showcase SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Showcase::ValueStreamSplitter< T > Class Template Reference

This allows consuming of single value stream by multiple consumers, so that each consumer will receive all values produced by the underlying stream. More...

#include <ValueStreamChannels.hpp>

Inheritance diagram for Showcase::ValueStreamSplitter< T >:
Showcase::ValueStream< T >

Public Member Functions

folly::Future< ReturnTypenext (int channel)
 
ChannelGuard
< ValueStreamChannel< T > > 
openChannel ()
 Opens new channel. More...
 
ChannelGuard
< ValueStreamChannel< T > > 
cloneChannel (int target)
 Ensures that all the values are passed to the new cloned channel.
 
std::shared_ptr< ValueStream< T > > stream ()
 This allows straight access to underlying stream. More...
 
- Public Member Functions inherited from Showcase::ValueStream< T >
int forEachSync (const std::function< void(const T &)> &f, int N, const std::function< bool(const T &)> &endCond=nullptr)
 Executes f for each next N values in the Stream as long as values are being generated. More...
 

Detailed Description

template<typename T>
class Showcase::ValueStreamSplitter< T >

This allows consuming of single value stream by multiple consumers, so that each consumer will receive all values produced by the underlying stream.

Member Function Documentation

template<typename T >
folly::Future< CallbackLock< T > > Showcase::ValueStreamSplitter< T >::next ( int  channel)

Start immediately work on promised things

template<typename T >
ChannelGuard< ValueStreamChannel< T > > Showcase::ValueStreamSplitter< T >::openChannel ( )

Opens new channel.

Starting point of the channel events is the same as the channel that has proceeded furthest on the stream

template<typename T >
std::shared_ptr< ValueStream< T > > Showcase::ValueStreamSplitter< T >::stream ( )

This allows straight access to underlying stream.

It is only available if no channels are opened.