How can I periodically write a ticking table to disk?

It's common to have queries on ticking tables where it's prudent to write that data to disk periodically. There are a few ways to do this.

Java ScheduledExecutorService

There are several ways to periodically call functions in Groovy. The following example uses Java's ScheduledExecutorService to write a ticking table to disk every 30 seconds.

Time table

You can also just use a time table to trigger writes. For instance, if you want to write every 30 seconds, have a time table tick every 30 seconds and call a Groovy function that writes the ticking table of interest to disk.