class ScheduledExecutorAsyncRunner implements AsyncRunner {

  @Override
  public <U> SafeFuture<U> runAsync(final Supplier<SafeFuture<U>> action) {
    if (shutdown.get()) {
      LOG.debug("Ignoring async task because shutdown is in progress");
      return new SafeFuture<>();
    }
    final SafeFuture<U> result = new SafeFuture<>();
    try {
      workerPool.execute(createRunnableForAction(action, result));
    } catch (final Throwable t) {
      handleExecutorError(result, t);
    }
    return result;
  }

    ScheduledExecutorAsyncRunner(
      final ScheduledExecutorService scheduler, final ExecutorService workerPool);

}