Closed rlugmania closed 2 months ago
We intentionally do not want to support string
because it'll lead to abuse of the ActorRegistry
. Users should be putting aggregates (i.e. parents, ShardRegion
s) into there, not individual entity actors et al - using Type
as the key helps enforce that good design (this is a "pit of success" design.)
FWIW, the actor's implementation type and the type key used in the ActorRegistry
don't have to have any relationship to each other - it's arbitrary. So your requirement today is already supported.
I am trying to register two actors from the same actor type using the WithActors Method, the current implementation based on types uses the name of the type for registering the actor, so that should be a good idea to implement a new method inside the IActorRegsitry interface that supports a string as a key instead of a type.
So the new method could be something like this:
For getting the actor instance the interface could be something similar to the dotnet keyed services by using an annotation like
[FromActorsName("player")]IRequiredActor<MyActor> playerActor