Is it possible to use ScheduledExecutorService with a webdyno or heroku shutdown the java process if no web call are made.
That an example of what I want to use
ScheduledExecutorService scheduler =
Executors.newSingleThreadScheduledExecutor();
final ScheduledFuture<?> timeHandle =
scheduler.scheduleAtFixedRate(new TimePrinter(System.out), 0, 10, SECONDS);
scheduler.schedule(new Runnable() {
public void run() {
}
}, 60*60, SECONDS);
You can certainly use the
ScheduledExecutorServiceon Heroku. There are no Java API limitations when running on Heroku. However, if you try to just shutdown the process, Heroku will attempt to start it back up. To handle scaling on Heroku you will need to call the Heroku management APIs.