案例解析Akka中的Actor运行机制以及Actor的生命周期
学习过案例解析Akka中的Actor运行机制以及Actor的生命周期,构建可伸缩的可扩展的分布式应用架构,是异步非阻塞的事件驱动。
案例如下:
object MapReduceApplication{
val _system=ActorSystem("HelloAkka")
val master=_system.actorOF(Propt[MassterActor], name="master")
master ! "Hi! My name is Roky."
master ! "Today, I'm going to read a news article for you."
master ! "I hope you'll like it."
Thread.sleep(500)
master ! new Result
Thread.sleep(500)
_system.shutdown
}
}
 
                    
                 
                
            
         
 浙公网安备 33010602011771号
浙公网安备 33010602011771号