Create a binding for an actor implemented by the given class, with the given name.
Create a binding for an actor implemented by the given class, with the given name.
This will instantiate the actor using Play's injector, allowing it to be dependency injected itself. The returned binding will provide the ActorRef for the actor, qualified with the given name, allowing it to be injected into other components.
Example usage from a Play module:
def bindings = Seq( Akka.bindingOf[MyActor]("myActor"), ... )
Then to use the above actor in your application, add a qualified injected dependency, like so:
class MyController @Inject() (@Named("myActor") myActor: ActorRef) extends Controller { ... }
The class that implements the actor.
The name of the actor.
A function to provide props for the actor. The props passed in will just describe how to create the actor, this function can be used to provide additional configuration such as router and dispatcher configuration.
A binding for the actor.
Create a provider for an actor implemented by the given class, with the given name.
Create a provider for an actor implemented by the given class, with the given name.
This will instantiate the actor using Play's injector, allowing it to be dependency injected itself. The returned provider will provide the ActorRef for the actor, allowing it to be injected into other components.
Typically, you will want to use this in combination with a named qualifier, so that multiple ActorRefs can be bound, and the scope should be set to singleton or eager singleton. *
The class that implements the actor.
The name of the actor.
A function to provide props for the actor. The props passed in will just describe how to create the actor, this function can be used to provide additional configuration such as router and dispatcher configuration.
A provider for the actor.
Retrieve the application Akka Actor system.
Retrieve the application Akka Actor system.
Example:
val newActor = Akka.system.actorOf[Props[MyActor]]
Helper to access the application defined Akka Actor system.