February 2018
Intermediate to advanced
552 pages
13h 46m
English
ActorSystem has one class and one object, as shown here:
object ActorSystem{ }
abstract class ActorSystem{ }
We can create an ActorSystem using one of its overload create() functions, as shown here:
val actorSystem1 = ActorSystem.create("FirstActorSystem") println(actorSystem1)
When we call the ActorSystem.create() method, it internally calls its available apply() methods, so we can simply use the following code to create an ActorSystem:
val actorSystem2 = ActorSystem("SecondActorSystem")
println(actorSystem2)
In both of these examples, we are giving a name to the ActorSystem. If we don't provide a name, Akka will assign a default name. Consider the following example:
import akka.actor.ActorSystem object ...
Read now
Unlock full access