graphql.kickstart.servlet.AsyncTaskExecutor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphql-java-servlet Show documentation
Show all versions of graphql-java-servlet Show documentation
relay.js-compatible GraphQL servlet
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);
}
}
}