class ScheduledExecutorAsyncRunner implements AsyncRunner {

  @Override
  @SuppressWarnings("FutureReturnValueIgnored")
  public <U> SafeFuture<U> runAfterDelay(
      final Supplier<SafeFuture<U>> action, final long delayAmount, final TimeUnit delayUnit) {
    if (shutdown.get()) {
      LOG.debug("Ignoring async task because shutdown is in progress");
      return new SafeFuture<>();
    }
    final SafeFuture<U> result = new SafeFuture<>();
    try {
      scheduler.schedule(
          () -> {
            try {
              workerPool.execute(createRunnableForAction(action, result));
            } catch (final Throwable t) {
              handleExecutorError(result, t);
            }
          },
          delayAmount,
          delayUnit);
    } catch (final Throwable t) {
      handleExecutorError(result, t);
    }
    return result;
  }

    ScheduledExecutorAsyncRunner(
      final ScheduledExecutorService scheduler, final ExecutorService workerPool);

}