-
Notifications
You must be signed in to change notification settings - Fork 645
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
Discuss whether importing ts-reaktive-marshal would be a good fit #63
Comments
I recently created akka/akka#21826, sort of related to this |
Oh yes, don't mind if I plug the lib there as well :) |
Looks interesting. I will probably take a look. |
@ktoso mentioned that it may be a better fit to have |
@jypma we finally looked at ts-reaktive again during last week's team meeting. Sorry for delaying this for so long. We think it is indeed a good fit for alpakka. We looked at the code a bit which looks well-structured so it shouldn't be too hard to extract. The scope would be the ts-reaktive-marshal and ts-reaktive-marshal-http modules. I'll try to summarize the functionality (please correct if I'm wrong):
Here are a few remarks:
WDYT? |
Adding context from gitter chat on last Friday which Johannes missed:
|
And just as a sanity check: I think Johannes's summary contains everything we discussed. |
The marshalling part of ts-reaktive (small presentation and demos here) provides a DSL to describe bi-directional marshalling of custom data types to and from XML or JSON. A short example:
The above
XMLProtocol
can then be used to create an akkaFlow
that (with proper back-pressure) takesXMLEvent
in andPerson
out, or,Person
in andXMLEvent
out.The result would read and write something like this:
An equivalent DSL exists for JSON, but using actual JSON primitives instead.
Combinators like
arrayList
,option
, etc. are shared between the two DSL.I think it's a nice fit for alpakka, since it allows us to describe higher-level XML API's in a streaming fashion. For example, we could streamingly list an S3 bucket. Note that akka-http's current streaming marshalling capabilities depend on specific "framing" use cases. This proposed library can split stream elements at (almost) arbitrary locations.
It'd need a Scala API in addition to the Java one of course, but that's small potatoes.
What do you think?
The text was updated successfully, but these errors were encountered: