enragedginger / akka-quartz-scheduler

Quartz Extension and utilities for cron-style scheduling in Akka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do jobs overlap?

vuongbason994 opened this issue · comments

Hi, would like to know if jobs overlap if the previous trigger is still running and exceeds the interval?

Hi @vuongbason994 jobs will fire on their regularly scheduled intervals. However, by design, Akka actors only process one message at a time, so you won't have to worry about the same job running simultaneously

Hi @enragedginger thanks for the prompt reply, I was just thinking if i have a use case for the same job running simultaneously how would i go about setting it up?

For example, in my scenario I will be processing a batch of forms submissions for the past 5 mins and the time taken to process a certain batch exceeds 5 mins whilst the next trigger occurs. I would like the next trigger to run simultaneously as well

What I meant was that I do not know for sure whether the processing time for the previous batch will exceed the time interval set, hence it is vital that the next trigger will get executed at the fixed intervals whilst any previous jobs continue processing

@vuongbason994 That's a good question. By design Akka actors only process one message at a time. However, you can set up pools of actors to achieve the desired effect. In this case you could set up a pool / shared mailbox / router on the ActorSelection that you pass to this library (or just pass in a ref to a single actor and then route / forward the message to your pool of actors from that single actor).

The Akka docs are a good resource for setting this up: https://doc.akka.io/docs/akka/2.5.4/scala/routing.html

Thanks so much again for your kind assistance! I will take a look at the akka docs then :) +1: