Create multiple channels using mux-demux
A channel is a function that pipes up the incoming stream to a persistant stream based on the incoming stream name.
This means that when multiple clients connect to the channel then each message to the channel is relayed to all of them
var MultiChannel =MuxDemux =channel =
Spin up multiple clients to note that each has been piped up to the back end channel. This basically functions as broadcasting to all open connections to the channel
var MuxDemux =mdm =var room1 = mdmroom2 = mdmroom1room2room1room2
multi channel was created to interact nicely with the stream router.
Notice how you can also pass a persistance store directly to multi channel so you have control over how the streamName to stream mapping occurs
var MultiChannel =MuxDemux =StreamRouter =StreamStore =var router =channel =router
If you use a store that has a database you can distribute your channels!
var MultiChannel =MuxDemux =RedisStore =var redisStore =channel =
npm install multi-channel-mdm