0
下面的代码是在叫我的程序的尽头(这是写在JRuby中):阿卡system.shutdown和awaitTermination
@na.tell(PoisonPill) if defined? @na # @na, @sa and @pe are Actors
@sa.tell(PoisonPill) if defined? @sa
@pe.tell(PoisonPill) if defined? @pe
@@system.shutdown # @@system is the ActorSystem
@@system.awaitTermination
我发现这种方法here,但我不明白为什么它的工作原理。
请问awaitTermination
是否等待所有演员终止?
是不是@@system
关闭之前awaitTermination
被称为?
编辑:我注意到我甚至不需要拨打tell(PoisonPill)
。我评论它,它仍然有效...