AKA doing something at set intervals.
For example, let's say I want to scan a certain directory every 60 seconds.
In Java, I would use a ScheduledExecutorService
like so:
Executor pool = Executors.newScheduledThreadPool(10)
pool.scheduleAtFixedRate(scanner, 0, 60, TimeUnit.SECONDS)
and that works fine.
The thing is, I'm thinking I'd like to try using Scala actors in my program, but I'm a little confused as to how to combine actors and Java Executors, or whether they should be.
I guess maybe I could have a simple runner which would merely send a message to an actor every N seconds -- does that make sense?