From the course: Java EE: Concurrency and Multithreading

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

scheduleAtFixedRate and scheduleWithFixedDelay

scheduleAtFixedRate and scheduleWithFixedDelay

From the course: Java EE: Concurrency and Multithreading

Start my 1-month free trial

scheduleAtFixedRate and scheduleWithFixedDelay

- [Teacher] Let's look at the other two flavors of the method that we have. Schedule With Fixed Delay, and shedule At Fixed Rate. Let's go back to the IDE and I'm going to come in this previous scheduled call that we did. And instead, I'm going to say, service.scheduleAtFixedRate. Okay, It is going to demand from you the runnable instance so, let's say cleaning scheduler, then, an initial delay that will be five seconds, a long period, let's say that four seconds and of course, the time unit is seconds that we want. Now, please understand that scheduling jobs generally occur in days, okay, but right now, for the demonstration purposes, I'm keeping the time unit as seconds. Otherwise, I wouldn't be able to show you how it is scheduled and how the run happens. Okay. There's one more thing that I have to do, since I'm scheduling this job, I have to run it periodically and I'm going to show you at least two runs or three runs of this method call. And in order to do that, I'll have to go…

Contents