-
Notifications
You must be signed in to change notification settings - Fork 23
Comparision with Orbit #65
Comments
Have you already looked at Akka Typed? What is missing that you are looking for? |
From looking at the code there, it does not feel like I'm really working with Actors anymore, but just some behaviors flying around. Creating a ActorSystem for a single actor/behavior also looks bad (and its one of the anti-patterns mentioned in the Akka Anti-Patterns talk) .. even then, it does not look like I'll have compile time support for working with the protocol of an actor.. or will my IDE be able to autocomplete the ask part this call or tell me which parameters are possible? At the moment it looks like this is a kind of mixture of akka-streams and FSM.. but it does not look or feel like Actors anymore.. I guess what I'm looking for is just a way to decorate a ActorRef with a defined protocol.. all the things with Behaviors, etc. feel quite overkill and not like "Akka" anymore. From this point of view, I really liked what I've seen on the Orbit webpage. |
Actors always are characterised by their behavior, in BTW: it is not at all necessary to create one ActorSystem per Actor, that would be quite nonsensical ;-) You could have your guardian actor offer the service of creating actors for the outside world, or you could also write the whole program or component as one actor hierarchy—with proper supervision all the way to the top. |
Y'all may want to spell this out more explicitly in the documentation somewhere -- the current docs left me scratching my head and wondering about this, because so many examples show "create an ActorSystem then create an Actor". That seemed odd, but it's the impression I was getting, especially because the ActorSystem is, itself, now typed. Question: is it legit to pass ActorRefs between separate ActorSystems? I'm trying to understand whether it is necessary for an application to create its own user guardian, which is ultimately (if indirectly) responsible for creating all the other Actors, or whether an application can/should be composed of multiple ActorSystems in a single process. I suspect the team finds this obvious one way or the other, but I didn't notice it discussed in the documentation, and it's really important. From traditional Akka, I would tend to expect that you should have a single ActorSystem in a process; given the constraints of Typed, that suggests that you must then create your own guardian, which provides typed APIs for creating all the subsidiary Actors. All of which makes sense, but as far as I can tell it never says that anywhere, and it's a huge difference from traditional Akka, where you routinely create stuff from the ActorSystem itself. Basically, in traditional Akka you are (potentially) building a forest of many trees, all rooted in the built-in user guardian. It sounds like, in Akka Typed, you are usually building a single tree, rooted in your own user guardian. Is that correct? One way or t'other, it probably ought to be spelled out in the docs, in the section that compares Akka Typed with traditional Akka... |
Thanks for highlighting the missing or misleading documentation around this. I created issue akka/akka#24867
That is the same as for untyped. You can pass ActorRefs in messages. For the initial lookup you would use the receptionist instead of actor selection. It would be wrong to pass an ActorRef as a direct in-memory reference between two actor systems running in the same jvm, and that is also invalid in untyped. If you for some reason run several actor systems in the same jvm, e.g. for testing, you should still retrieve and pass the actor references with the same mechanisms as you would if they were distributed.
yes, system.actorOf is not supported when you have started the actor system with a custom user guardian, instead that should be replaced by context.spawn in the user guardian. However, if you have an existing untyped application and want to introduce a few typed actors you can still start the |
Okay, that's what I figured -- and once I realized that, I figured you pretty much had to create your own user guardian. But I wasn't certain. Good to know... |
Yesterday I stumbled upon Orbit https://github.com/orbit/orbit
What I really liked is the way of having a type-safe way to interact with an actor.. e.g. the Actors protocol is defined through an interface / a trait that I can apply to my ActorRef to have a type-safe way to interact with it.
Its basically, what I'm now doing in a manual way to interact with my actors from the outside world, where I create a service that has methods returning futures, and inside those methods I'm either just telling or asking and then mapping the expected messages back to some distinct types.
Couldn't we use this approach in Akka as well?
where ActorAsk and ActorTell are basically futures ?
The text was updated successfully, but these errors were encountered: