pull-stream / pull-stream-faq

21 stars 2 forks source link

Is there an idiomatic way to tee for each match? #7

Open christianbundy opened 4 years ago

christianbundy commented 4 years ago

Let's say you have a stream like:

{ "name": "Aardvark", "text": "hey" }
{ "name": "Baboon", "text": "hello" 
{ "name" "Aardvark": "text": "wanna watch a movie" }

I want to tee, but instead of ending up with two streams I want to spawn one stream per .name. In the above example, I should end up with two streams, one for Aardvark and one for Baboon. If there are more participants, I'd like to have more streams. Is there a canonical way to do this?