code: public static void scheduleWithFixedDelay(
        final ScheduledExecutorService exec,
        final Duration initialDelay,
        final Duration delay,
        final Callable<Signal> callable
    )
    {
      log.debug("Scheduling repeatedly: %s with delay %s", callable, delay);
      exec.schedule(
          new Runnable()
          {
            @Override
            public void run()
            {
              try {
                log.debug("Running %s (delay %s)", callable, delay);
                if (callable.call() == Signal.REPEAT) {
                  log.debug("Rescheduling %s (delay %s)", callable, delay);
                  exec.schedule(this, delay.getMillis(), TimeUnit.MILLISECONDS);
                } else {
                  log.debug("Stopped rescheduling %s (delay %s)", callable, delay);
                }
              }
              catch (Throwable e) {
                log.error(e, "Uncaught exception.");
              }
            }
          },
          initialDelay.getMillis(),
          TimeUnit.MILLISECONDS
      );
    }
docs: Run callable repeatedly with the given delay between calls, until it
  returns Signal.STOP. Exceptions are caught and logged as errors.