Creating akka streams from webservice response


(Mghildiy) #1

Hi,

I want to make use of akka streams to work with huge data which I receive from a web service.
Basically, my aim is to stream this huge data to clients of my program(web client usually). I receive data in entirety, and not i in streams. So I need to create streams from this data and send it to clients which can then progressively process it.

What are the best practices for same?


(Martynas Mickevičius) #2

Source.unfold can help you here. You can use that to chunk up the data into a stream of ByteString and also calculate the next position of the chunk.


(Mghildiy) #3

Thanks for input.