In Akka, I can initialize an actor system from the main(), like this:
object HostManagerApp {
def main(args: Array[String]) {
val system = ActorSystem("Foo", ConfigFactory.load.getConfig("Bar"))
}
}
Alternatively, I can do the same from a class that extends Bootable. As mentioned in the docs, this also allows me to start the app from the command line. What's the difference between the two approaches?
Its a way to make your code more modular. Using Bootable you can have different independent actor systems in different scala classes all bootstrapping independently, instead of putting them all in one main class.
Bootable is used with the Akka Microkernel, and if you package your Akka application as a Bootable then you can run multiple applications within the same ActorSystem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With