use of graphql.execution.AsyncSerialExecutionStrategy in project graphql-java by graphql-java.
the class ExecutionExamples method exampleExecutorServiceExecutionStrategy.
private void exampleExecutorServiceExecutionStrategy() {
ExecutorService executorService = new ThreadPoolExecutor(2, /* core pool size 2 thread */
2, /* max pool size 2 thread */
30, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new ThreadPoolExecutor.CallerRunsPolicy());
GraphQL graphQL = GraphQL.newGraphQL(StarWarsSchema.starWarsSchema).queryExecutionStrategy(new ExecutorServiceExecutionStrategy(executorService)).mutationExecutionStrategy(new AsyncSerialExecutionStrategy()).build();
}
Aggregations