以下CoreActors中的“ this:Core => ”是什么。
import akka.actor.ActorSystem
import com.demo.service.DemoService
import com.typesafe.config.ConfigFactory
trait Core {
implicit def system: ActorSystem
}
trait BootedCore extends Core {
implicit lazy val system = ActorSystem("demo-microservice-system")
sys.addShutdownHook(system.shutdown())
}
trait ConfigHolder {
val config = ConfigFactory.load()
}
trait CoreActors extends ConfigHolder {
this: Core =>
val demoService = system.actorOf(
DemoService.props("identity"), "DemoService")
val services: Services = Map(
"demoService" -> demoService
)
}