The scheduler is a service for scheduling other services/jobs (it uses the open source Quartz library). The scheduler can be used in two ways, by registering the job through the scheduler API and by leveraging the whiteboard pattern that is supported by the scheduler.
more
Note: To create a scheduler click this link
Scheduling at periodic times - The following job is executed every ten seconds by setting scheduler.period to 10:
We can write a scheduler using Schedular API.
The following code sample defines a job object that writes a message in the logs:
To execute the job as defined above at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday, you can use the addJob() method with the following parameters:
To execute the job as defined above every 3 minutes (180 seconds), you can use the addPeriodicJob() method with the following parameters:
To execute the job as defined above at a specific date (on January 10th 2020), you can use the fireJobAt() method with the following parameters: