我已经通过这个文档http://doc.akka.io/docs/akka/snapshot/scala/microkernel.html#microkernel-scala使用微内核制作独立的 akka 应用程序。我已经完成了它的依赖和 sbt 插件。这是我的主要课程:
package id.nolimit.platform.store.actor
import com.typesafe.config.ConfigFactory
import akka.actor.ActorSystem
import akka.actor.Props
import akka.routing.RoundRobinRouter
import akka.kernel.Bootable
object AppMainKernel extends Bootable{
val system = ActorSystem("PlatformStore", ConfigFactory.load().getConfig("RemoteSys"))
def startup = {
val storeActor = system.actorOf(Props(new StoreActor).withDispatcher("dispatcher").withRouter(RoundRobinRouter(nrOfInstances = 5)), name = "storeActor")
}
def shutdown = {
system.shutdown()
}
}
线程'main'到底发生了什么?谢谢 :)