How to correctly use ScheduledExecutorService?
问题 So this is my first time using ScheduledFuture and I admit I'm probably way over my head here. I cannot seem to get the below sample to work. Goal is simply to take two sets of actions each with it's own timeout before moving on to the next set and repeating indefinitely. static ScheduledExecutorService executor = Executors.newScheduledThreadPool(2); ScheduledFuture<?> warm = executor.scheduleWithFixedDelay(() -> { System.out.println("warmbeans"); //do more stuff here }, 0, 1000, TimeUnit