AKA does something at set intervals.
For example, let's say I want to scan a specific directory every 60 seconds.
In Java, I would use ScheduledExecutorService:
Executor pool = Executors.newScheduledThreadPool(10)
pool.scheduleAtFixedRate(scanner, 0, 60, TimeUnit.SECONDS)
and it works great.
The fact is that I would like to try using Scala actors in my program, but I'm a little confused about how to combine Java participants and artists, or they should be.
Maybe I can have a simple runner who just sends a message to the actor every N seconds - does that make sense?
source
share