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)
。我評論它,它仍然有效...