Check out example codes for "grails 3 cron jobs". It will help you in understanding the concepts better.
Code Example 1
package asia.grails.sample
class ArchiveTablesJob {
static triggers = {
simple repeatInterval: 5000l // execute job once in 5 seconds
}
def execute() {
// execute job
}
}
Learn ReactJs, React Native from akashmittal.com