GithubHelp home page GithubHelp logo

Check for type params of more classes in AkkaSerializabilityCheckerPluginComponent and DumpEventSchemaPluginComponent about akka-serialization-helper HOT 6 CLOSED

virtuslab avatar virtuslab commented on June 16, 2024
Check for type params of more classes in AkkaSerializabilityCheckerPluginComponent and DumpEventSchemaPluginComponent

from akka-serialization-helper.

Comments (6)

MarconZet avatar MarconZet commented on June 16, 2024

Do you mean like creating a custom, one-time usage plugin that would go over Hydra and collect references by generic arguments of @SerializabilityTrait?

from akka-serialization-helper.

PawelLipski avatar PawelLipski commented on June 16, 2024

Ideally, I'd rather go over all(-ish) classes in common Akka dependencies and see which of them have type params corresponding to messages/events/persistent state :goncern:

from akka-serialization-helper.

PawelLipski avatar PawelLipski commented on June 16, 2024

I know this might be hard to achieve tho, unless Akka is very rigorous about always naming type params in an unambiguous way; good news is that probably won't require any plugin, just basic reflection should be enough

from akka-serialization-helper.

PawelLipski avatar PawelLipski commented on June 16, 2024

I think it doesn't even need to a one-time tool, it can just live in this repository, to be used in future (maybe with some slight modifications if needed); reusability/reproducibility FTW

from akka-serialization-helper.

MarconZet avatar MarconZet commented on June 16, 2024

Ideally, I'd rather go over all(-ish) classes in common Akka dependencies and see which of them have type params corresponding to messages/events/persistent state :goncern:

I don't understand.
Type parameter is just a generic, nothing inherently links it to serialisation.

from akka-serialization-helper.

PawelLipski avatar PawelLipski commented on June 16, 2024

Type parameter is just a generic, nothing inherently links it to serialisation.

Yes, I agree that nothing about the type param links it serialization.
However, our purpose here is to detect the set of user-defined types that are messages, events and persistent state as accurately as possible.

AFAIK the reasonable way to do that is to see which types has been used as type parameters of types like akka.actor.typed.Behavior, akka.persistence.typed.scaladsl.Effect, which we already do... but also e.g. akka.actor.typed.ActorRef (which we don't so far :/).
In general, it's non-trivial to collect the entire such set of Akka-defined types... the clue that we can is the fact that in certain cases, these type params have explicit names, e.g.:

trait ReplyEffect[+Event, State] extends Effect[Event, State]

Although relying on type param names wouldn't work e.g. for akka.actor.typed.ActorRef:

trait ActorRef[-T] extends RecipientRef[T] with java.lang.Comparable[ActorRef[_]] with java.io.Serializable

from akka-serialization-helper.

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.