My application invokes the following timer task from another class OnStart right away, one of the problems I'm trying to avoid is having the the next task invoked before the first one is done. How do I approach this?
import ratpack.server.Service
import ratpack.server.StartEvent
import ratpack.server.StopEvent
import java.util.timer.*
class FTPPoller implements Service {
@Override
void onStart(StartEvent event) throws Exception {
println 'Hey, I started'
new Timer().schedule({FTPlisten.FTPdownload("localhost", "*****", "*****")} as TimerTask, 1000, 5000)
}
}