I can create actors with actorOf
and look them with actorFor
. I now want to get an actor by some id:String
and if it doesnt exist, I w
Currently you can use Guice dependency injection with Akka, which is explained at http://www.lightbend.com/activator/template/activator-akka-scala-guice. You have to create an accompanying module for the actor. In its configure method you then need to create a named binding to the actor class and some properties. The properties could come from a configuration where, for example, a router is configured for the actor. You can also put the router configuration in there programmatically. Anywhere you need a reference to the actor you inject it with @Named("actorname"). The configured router will create an actor instance when needed.