- Scala/Akka Application
- I have a task that processes entries in a batch.
- Assuming the scheduler runs after every 5 seconds and the current task being executed takes 7 seconds.
i. Will the scheduler start another instance of the Task before the previous task finishes?
ii. How can I prevent a scheduler from starting an instance of a task before the previous once completes?
Code samples
val task = new Runnable { def run() { processBatch } }
scheduler.schedule(
initialDelay = 0 seconds,
interval = 5 seconds,
runnable = task)