Demultiplex a multiplexed stream into individual sub-streams.
Demultiplex a multiplexed stream into individual sub-streams. An implicit MultiStream is required in order to determine the proper substream of each message in the multiplexed stream.
The multiplexed source
the internal buffer size of the stream of sources
the internal buffer size of each newly created substream
A Source of substreams
Multiplex a base Sink into a multiplexed Sink[SubSource[K,T]]
.
Multiplex a base Sink into a multiplexed Sink[SubSource[K,T]]
. See
the docs on Multiplexing for more details.
The sink to multiplex
A multiplexing Sink that can accept new sources to route into the base sink
Multiplexing is the process of combining multiple independant streams into a single stream. Each message in the multiplexed stream carries information about which sub-stream it originated from, so that eventually the stream can be demultiplexed back into the constituent sub-streams.
By multiplexing a "base"
Sink[T]
, a newSink[SubSource[K,T]]
is created, with each SubSource containing aSource[T]
. When a Source is pushed into the multiplexing sink, all messages pushed to that source are routed into the base sink.Likewise, demultiplexing a multiplexed
Source[T]
will create aSource[SubSource[K,T]]
, with each SubSource being one of the sub-streams being fed into the multiplexed source.