All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.kickstart.servlet.AsyncTaskExecutor Maven / Gradle / Ivy

package graphql.kickstart.servlet;

import java.util.concurrent.Executor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
class AsyncTaskExecutor implements Executor {

  private final Executor executor;
  private final AsyncTaskDecorator taskDecorator;

  @Override
  public void execute(@NonNull Runnable command) {
    if (taskDecorator != null) {
      Runnable decorated = taskDecorator.decorate(command);
      executor.execute(decorated);
    } else {
      executor.execute(command);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy