Since reading the docs for Lagom and Akka, I’ve been able to make a ‘service’ that is itself just an injected ActorSystem, and can spawn child actors/pools/routers as needed to do the various things it needs to do. I’ve also read the section of the docs in Migrating to Akka Typed Persistence, and I’ve been using typed actors for that, but one thing that I’ve noticed the docs are a little “old” about is the Advanced usage of using Akka Actors with a Service implementation.
From what I understood of the Akka Typed system is that since Lagom 1.6.x uses Akka-Typed, the ActorSystem available is equally a typed actor system for each Service, but for the sake of documentation, it’s still referencing the ‘classic’ system way of spawning child actors and such. This is where I’m a little confused and/or seeking clarity:
- For an injected Service, is it acceptable to believe that the parent
ActorSystem[Unit]as injectable, and therefor we’re not quite able to assert the
Serviceimplementation is an
Actoritself, but a more glorified behavior for the various parameterized messages routed through Lagom?
- While we’re not currently able to inject a typed
ActorSystem<Void>to a service, or ReadSideProcessor, we’re able to inject a classic
ActorSystem, while other injectable modules, we’re able to fully create the typed ActorSystem of the guardian actor. Is it expected that Lagom will move towards the typed library over time when it’s fully released?
- Currently, I stumbled on a play documentation for dependency injection with typed actors, and noticed usage of
Adapter.spawn(classic.ActorSystem, Behavior<T>, String), and under the hood, it seems like this is the only way to go about spawning child actors within a dependency injected framework, is this correct?