FS2 stream inside a stream

305 Views Asked by At

I have an FS2 stream that reads a queue and for each received message, it then reads a file as a stream. How do I model such a stream inside a stream in FS2 ?

I can achieve this using a flatMap operation such as Stream(1,2,3).flatMap(i => Stream(i,i)).toList, but is there any FS2 style way to do this?

At the end of the second inner stream, I also want to transform the original first outer stream with a FS2.through using a pipe.

0

There are 0 best solutions below