{@inheritDoc}

@see org.audit4j.core.schedule.TaskScheduler#scheduleAtFixedRate(java.lang.Runnable, long)
766951
@Override
    public ScheduledFuture<?> scheduleAtFixedRate(Runnable task, long period) {
        ScheduledExecutorService executor = getScheduledExecutor();
        try {
            return executor.scheduleAtFixedRate(errorHandlingTask(task, true), 0, period, TimeUnit.MILLISECONDS);
        } catch (RejectedExecutionException ex) {
            throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
        }
    }
61581
void scheduleOnPostNotificationExecutor(@NonNull Runnable runnable, /* Milliseconds */ long delay) {
        try { postExecutor.schedule(runnable, delay, TimeUnit.MILLISECONDS); }
        catch (RejectedExecutionException ignore) { }
    }
692830
public String schedule(String pattern, Runnable task) {
		return schedule(pattern, new RunnableTask(task));
	}
486355
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
		rpcServer.scheduleRunAsync(runnable, unit.toMillis(delay));
	}
921145
public <T extends Runnable> T executeAsync(T runnable) {
		synchronized (this.tasks) {
			this.tasks.add(runnable);
			// Notify that a task has been added
			this.tasks.notifyAll();

			if (this.tasks.size() == 1) {
				this.onTaskBecameNotEmpty();
			}

			this.onTaskAdded();
		}
		return runnable;
	}
555772
protected ScheduledFuture<?> startTimer() {
        return getExecutorService().scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                endOfPeriod();
            }
        }, getPeriod(), getPeriod(), getUnit());
    }
414145
public <V> ScheduledFuture<V> schedule(Callable<V> callable, TemporalAccessor time)
    {
        ensureWaiterRunning();
        log(logLevel, "schedule(%s, %s)", callable, time);
        RunnableScheduledFutureImpl future = new RunnableScheduledFutureImpl(callable, Instant.from(time), null, false);
        delayQueue.add(future);
        return future;
    }
682055
public static void scheduleWithFixedDelay(ScheduledExecutorService exec, Duration delay, Callable<Signal> callable)
  {
    scheduleWithFixedDelay(exec, delay, delay, callable);
  }
535782
@SuppressWarnings("PMD")
  static <T> void schedule(
      ScheduledExecutorService executor, WeakReference<T> ref, long delay, Consumer<T> poll) {
    final AtomicReference<Future<?>> futureRef = new AtomicReference<>();
    final Runnable cancel = () -> {
      Future<?> f = futureRef.get();
      if (f != null) {
        f.cancel(false);
      }
    };
    final Runnable task = () -> {
      try {
        T r = ref.get();
        if (r != null) {
          poll.accept(r);
        } else {
          cancel.run();
        }
      } catch (Throwable t) {
        cancel.run();
      }
    };
    futureRef.set(executor.scheduleWithFixedDelay(task, delay, delay, TimeUnit.MILLISECONDS));
  }
34304
public static ScheduledFuture<?> runWithSchedule(long delayMillis,
            Runnable runnable) {
        return newSingleScheduledThreadPool()
                .schedule(
                        buildRunnableWithLogging("runWithSchedule", runnable,
                                delayMillis),
                        delayMillis, TimeUnit.MILLISECONDS);
    }
1172957
void tick(long index, long timestamp) {
    // Only create an iterator if there are actually tasks scheduled.
    if (!scheduledTasks.isEmpty()) {

      // Iterate through scheduled tasks until we reach a task that has not met its scheduled time.
      // The tasks list is sorted by time on insertion.
      Iterator<ServerScheduledTask> iterator = scheduledTasks.iterator();
      while (iterator.hasNext()) {
        ServerScheduledTask task = iterator.next();
        if (task.complete(timestamp)) {
          context.update(index, Instant.ofEpochMilli(task.time), ServerStateMachineContext.Type.COMMAND);
          task.execute();
          complete.add(task);
          iterator.remove();
        } else {
          break;
        }
      }

      // Iterate through tasks that were completed and reschedule them.
      for (ServerScheduledTask task : complete) {
        task.reschedule();
      }
      complete.clear();
    }
  }
758796
public static void scheduleAtFixedRate(
      final ScheduledExecutorService exec,
      final Duration initialDelay,
      final Duration period,
      final Runnable runnable
  )
  {
    scheduleAtFixedRate(exec, initialDelay, period, new Callable<Signal>()
    {
      @Override
      public Signal call()
      {
        runnable.run();
        return Signal.REPEAT;
      }
    });
  }
977788
@Override
    public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) {
        synchronized (this.futures) {
            if (this.shutdown) throw new RejectedExecutionException();
            ScheduledFuture<?> future = this.executor.scheduleAtFixedRate(command, initialDelay, period, unit);
            this.futures.add(future);
            return future;
        }
    }
826202
@Override
    public ScheduledFuture<?> scheduleWithFixedDelay(Runnable task, Date startTime, long delay) {
        ScheduledExecutorService executor = getScheduledExecutor();
        long initialDelay = startTime.getTime() - System.currentTimeMillis();
        try {
            return executor.scheduleWithFixedDelay(errorHandlingTask(task, true), initialDelay, delay,
                    TimeUnit.MILLISECONDS);
        } catch (RejectedExecutionException ex) {
            throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task, ex);
        }
    }
1112051
public static void scheduleAtFixedRate(ScheduledExecutorService exec, Duration rate, Runnable runnable)
  {
    scheduleAtFixedRate(exec, rate, rate, runnable);
  }
1254406
public static ScheduledFuture<?> runWithScheduleWithFixedDelayOnStartTime(
            ZonedDateTime startDateTime, long delayMillis, Runnable runnable) {
        return runWithScheduleWithFixedDelay(
                calInitialDelayMillis(startDateTime), delayMillis,
                "runWithScheduleWithFixedDelayOnStartTime", runnable);
    }
133895
protected void scheduleRunAsync(Runnable runnable, Time delay) {
		scheduleRunAsync(runnable, delay.getSize(), delay.getUnit());
	}