@PublicApi public class ExecutorServiceExecutionStrategy extends ExecutionStrategy
ExecutorServiceExecutionStrategy uses an ExecutorService
to parallelize the resolve.
execute(ExecutionContext, ExecutionParameters)
implementation, ExecutorService
MUST have the following 2 characteristics:
ThreadPoolExecutor
MUST have a reasonable maximumPoolSize
ThreadPoolExecutor
SHALL NOT use its task queue.
Failure to follow 1. and 2. can result in a very large number of threads created or hanging. (deadlock)
Seegraphql.execution.ExecutorServiceExecutionStrategyTest
for example usage.fieldCollector, valuesResolver
Constructor and Description |
---|
ExecutorServiceExecutionStrategy(java.util.concurrent.ExecutorService executorService) |
Modifier and Type | Method and Description |
---|---|
ExecutionResult |
execute(ExecutionContext executionContext,
ExecutionParameters parameters) |
completeValue, completeValueForEnum, completeValueForList, completeValueForScalar, getFieldDef, handleDataFetchingException, resolveField, resolveTypeForInterface, resolveTypeForUnion
public ExecutorServiceExecutionStrategy(java.util.concurrent.ExecutorService executorService)
public ExecutionResult execute(ExecutionContext executionContext, ExecutionParameters parameters)
execute
in class ExecutionStrategy