-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming JSON Requests #667
Comments
I think the path forward here is to push this kind of functionality out of the finch-core and use something like fs2 and iteratee instead. There is a PR that introduces iteratee support in Finch (see #557) - this is what we need to be focusing on. I still want to keep the very basic |
I've picked it up and made some good progress. My approach is following:
I guess it'll simplify life of potential users by hiding Iteratee/Enumeratee stuff under the hood. Have to think about API, probably it's possible to reuse |
Thanks @imliar! This is really cool! One thought: I think we shouldn't try sticking to It thinks there is nothing wrong with just As far as the JSON streaming goes, we should probably build everything within finch-circe for now (using both circe-streaming and iteratee). We can provide something like |
After dealing with Iteratee/Enumeratee for some time I have a feeling that it's complicated thing, so with exposing em outside this complexity will be shifted to finch users. Not sure about it. Why |
We've been having lots of issues w.r.t. resource management in I think it's fine to expose Iteratee/Enumeratee powered endpoints withing a Circe context since it's what Crice uses itself. We'll see how much adoption it gets and then make a final decision whether or not we need to stick with I think @travisbrown may have some insight on |
I think we can close this now, after almost a year (h/t @imliar). |
Right now (as per 0.11) it's possible to stream JSON objects over the HTTP response (chunked) via
AsyncStream[CaseClass]
. Although, there is near zero support for the inbound streaming (streaming requests). This issue is related to #336.I assume, for each JSON library we support, we can provide meanings for converting
AsyncStream[Buf]
intoAsyncStream[CaseClass]
. This might require a new type class for decoding since theDecode
abstraction we have goes fromBuf
toTry[A]
. Technically, we could utilize that and build something close to Netty's replying decoder (returnThrow
when we need more data), but in that case, it would be impossible to distinct streaming and non-streaming decoders (in case if we need too).Anyways, there are lots of open questions here, but it seems totally possible to me (with zero API changes).
NOTE: @travisbrown has kindly agreed to find some time and work on iteratees support for Circe. This would mean that for Circe there will be two streaming APIs via AsyncStream and via iteratees (see #557).
The text was updated successfully, but these errors were encountered: