@@ -0,0 +1,1044 @@
+package com.github.dreambrother.hackernews.worker;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.concurrent.Executors;%0Aimport java.util.concurrent.ScheduledExecutorService;%0Aimport java.util.concurrent.TimeUnit;%0A%0Apublic class ScheduledPublicator %7B%0A%0A    private static final Logger log = LoggerFactory.getLogger(ScheduledPublicator.class);%0A%0A    private ScheduledExecutorService scheduledExecutorService;%0A%0A    public void start(Publicator publicator, int delayMillis) %7B%0A        log.info(%22Start scheduled publicator%22);%0A        scheduledExecutorService = Executors.newSingleThreadScheduledExecutor();%0A        scheduledExecutorService.scheduleWithFixedDelay(publicator, 0, delayMillis, TimeUnit.MILLISECONDS);%0A    %7D%0A%0A    public void shutdown() %7B%0A        if (scheduledExecutorService != null) %7B%0A            log.info(%22Shutdown scheduled publicator%22);%0A            scheduledExecutorService.shutdown();%0A        %7D else %7B%0A            log.warn(%22Attempt to shutdown scheduled publicator without starting it!%22);%0A        %7D%0A    %7D%0A%7D%0A

add scheduled publicator