Bytestring is just a byte array, not necessarily the whole response.
Akka on its default settings should do just what you want here, i.e.
process the response in a streaming fashion.
Check out
https://doc.akka.io/docs/alpakka/current/data-transformations/json.html#streaming-of-nested-structures
for
a streaming JSON parser
On Monday, April 27, 2020 at 1:44:21 PM UTC+1, Dennis Haupt wrote:
>
> a quick google search didn't find anything
> what i want to do it this: (pseudocode)
>
> val stream = ConnectToServer("
> http://somewhere:8080/get/some/huge/json/array")
> stream.toValidJsonChunks.map(parseJson).process(doThisWithEachElement)
>
> i want the data to be streamed to the client. all examples i found involve
> "bytestring" which (as far as i understood) always contains the entire http
> response, but this is exactly what i want to avoid. the response can be
> very big (several gb) and all the elements can be processed individually,
> so i want to load a few mb, process a batch, load the next batch, process
> it and so on.
> is this possible?
>
--
*****************************************************************************************************
** New discussion forum: https://discuss.akka.io/ replacing akka-user
google-group soon.
** This group will soon be put into read-only mode, and replaced by
discuss.akka.io
** More details: https://akka.io/blog/news/2018/03/13/discuss.akka.io-announced
*****************************************************************************************************
>>>>>>>>>>
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/akka-user/1576abfa-eb32-4527-890a-cda87be767e9%40googlegroups.com.