How can I have an Akka actor executed every 5 min?

前端 未结 4 1784
离开以前
离开以前 2020-12-23 11:01

I\'d like to know if there are any mechanism in Akka that can have an actor executed periodically?

4条回答
  •  轮回少年
    2020-12-23 11:44

    If anyone want java code then they can do like this

        Cancellable cancellable = system.scheduler().schedule(Duration.Zero(), Duration.create(5, TimeUnit.MINUTES), cronActor, "tick", system.dispatcher(), null);
    

提交回复
热议问题