GithubHelp home page GithubHelp logo

Comments (7)

johanandren avatar johanandren commented on July 20, 2024

I recently created akka/akka#21826, sort of related to this

from alpakka.

jypma avatar jypma commented on July 20, 2024

Oh yes, don't mind if I plug the lib there as well :)

from alpakka.

drewhk avatar drewhk commented on July 20, 2024

Looks interesting. I will probably take a look.

from alpakka.

jypma avatar jypma commented on July 20, 2024

@ktoso mentioned that it may be a better fit to have ts-reaktive-marshal augment/replace the JSON framing support in akka-http, rather than have it in alpakka.

from alpakka.

jrudolph avatar jrudolph commented on July 20, 2024

@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):

  • Java DSLs for specifying marshalling formats from / to XML and JSON
  • Streaming parsers that allow parsing XML and JSON data using the above marshallers
  • Glue code to make it easy to use with akka-http

Here are a few remarks:

  • Dependencies:
  • Let's put all of the code into a single module that has a provided dependency on akka-http. This way you can either use it with or without akka-http without needing an extra module.
  • The usage of javaslang internally is fine (though binary compatibility might become a problem if javaslang starts to become commonly used in incompatible versions). Not exposing javaslang in the API might simplify changing internals later on (e.g. partial reimplementation in Scala).
  • A Scala API for the marshaller would be nice-to-have but not strictly required for the first version.

WDYT?

from alpakka.

ktoso avatar ktoso commented on July 20, 2024

Adding context from gitter chat on last Friday which Johannes missed:

Jan Ypma @jypma Mar 23 11:30
I was a bit worried "requiring" a certain version... but actually, now I think of it, the bindings for their collections possibly need to change together with the version anyways.
OK, let's go for
implementation depends on Javaslang
plain Java collection bindings separate from javaslang bindings (can be in the same JAR though, javaslang is already on board)
scala bindings in a separate JAR
?
however, the internal API would then still hava Javaslang signatures. In other words, if one would want to add support for e.g. YAML or sth, you'd be coding against Javaslang classes.

Patrik Nordwall @patriknw Mar 23 11:34
sounds good, but why scala bindings in separate jar (scala is also already a dependency)?

Jan Ypma @jypma Mar 23 11:40
it isn't. It only is for the layer that binds the marshalling to akka streams. The basic marshalling doesn't depend on scala (or akka). The thing can conceivably be used with e.g. RxJava


@ktoso is this acceptable as far as scala marshalling DSL? https://github.com/Tradeshift/ts-reaktive/pull/56/files#diff-87884016caa105133b216b64cd5088faR17 If so, I'll park that PR and start working on a first PR onto alpakka, as tentatively talked about with Patrik.

from alpakka.

ktoso avatar ktoso commented on July 20, 2024

And just as a sanity check: I think Johannes's summary contains everything we discussed.
So the parsing is one thing, and the nice glue code for HTTP is another :)

from alpakka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.