Created
May 22, 2019 06:47
-
-
Save vmarcinko/35ae2af5bb3f51cea7c2efee74881899 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(); | |
// ... | |
private void startProcessingTask() { | |
logger.info("Starting queue processing task with delay of {} secs", this.pollingPeriodInSecs); | |
Runnable command = this::processQueuedItems; | |
this.processingTask = this.scheduledExecutorService.scheduleWithFixedDelay(command, pollingPeriodInSecs, pollingPeriodInSecs, TimeUnit.SECONDS); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment