本文整理汇总了Java中graphql.execution.ExecutionStrategy类的典型用法代码示例。如果您正苦于以下问题:Java ExecutionStrategy类的具体用法?Java ExecutionStrategy怎么用?Java ExecutionStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ExecutionStrategy类属于graphql.execution包,在下文中一共展示了ExecutionStrategy类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GraphQL
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
/**
* A GraphQL object ready to execute queries
*
* @param graphQLSchema the schema to use
* @param queryStrategy the query execution strategy to use
* @param mutationStrategy the mutation execution strategy to use
* @deprecated use the {@link #newAsyncGraphQL(GraphQLSchema)} builder instead. This will be
* removed in a future version.
*/
public GraphQL(GraphQLSchema graphQLSchema, ExecutionStrategy queryStrategy,
ExecutionStrategy mutationStrategy) {
super(graphQLSchema, queryStrategy, mutationStrategy);
assert queryStrategy instanceof AsyncExecutionStrategy :
"Async graphql requires an async query strategy";
assert mutationStrategy instanceof AsyncExecutionStrategy :
"Async graphql requires an async mutation strategy";
assert ((AsyncExecutionStrategy) mutationStrategy).isSerial() :
"Async graphql requires a serial mutation strategy";
}
示例2: createQueryExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
protected ExecutionStrategy createQueryExecutionStrategy() {
return createExecutionStrategy(
processorProperties.getMinimumThreadPoolSizeQuery(),
processorProperties.getMaximumThreadPoolSizeQuery(),
processorProperties.getKeepAliveTimeInSecondsQuery(),
"graphql-query-thread-"
);
}
示例3: createMutationExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
protected ExecutionStrategy createMutationExecutionStrategy() {
return createExecutionStrategy(
processorProperties.getMinimumThreadPoolSizeMutation(),
processorProperties.getMaximumThreadPoolSizeMutation(),
processorProperties.getKeepAliveTimeInSecondsMutation(),
"graphql-mutation-thread-"
);
}
示例4: createSubscriptionExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
protected ExecutionStrategy createSubscriptionExecutionStrategy() {
return createExecutionStrategy(
processorProperties.getMinimumThreadPoolSizeSubscription(),
processorProperties.getMaximumThreadPoolSizeSubscription(),
processorProperties.getKeepAliveTimeInSecondsSubscription(),
"graphql-subscription-thread-"
);
}
示例5: createExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
private ExecutionStrategy createExecutionStrategy(Integer minimumThreadPoolSize, Integer maximumThreadPoolSize, Integer keepAliveTimeInSeconds, String threadNamePrefix) {
return new ExecutorServiceExecutionStrategy(new ThreadPoolExecutor(
minimumThreadPoolSize,
maximumThreadPoolSize,
keepAliveTimeInSeconds,
TimeUnit.SECONDS,
new SynchronousQueue<>(),
new CustomizableThreadFactory(threadNamePrefix),
new ThreadPoolExecutor.CallerRunsPolicy())
);
}
示例6: getExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
@JsonProperty
public ExecutionStrategy getExecutionStrategy() {
switch (executionStrategy) {
case "batched":
return new BatchedExecutionStrategy();
case "async_serial":
return new AsyncSerialExecutionStrategy();
case "subscription":
return new SubscriptionExecutionStrategy();
case "async":
default:
return new AsyncExecutionStrategy();
}
}
示例7: queryExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
public Builder queryExecutionStrategy(ExecutionStrategy executionStrategy) {
assertNotNull(executionStrategy, "Query ExecutionStrategy must be non null");
this.queryExecutionStrategy = executionStrategy;
return this;
}
示例8: mutationExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
public Builder mutationExecutionStrategy(ExecutionStrategy executionStrategy) {
assertNotNull(executionStrategy, "Mutation ExecutionStrategy must be non null");
this.mutationExecutionStrategy = executionStrategy;
return this;
}
示例9: getExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
public ExecutionStrategy getExecutionStrategy() {
return delegate.getExecutionStrategy();
}
示例10: setExecutionStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
public void setExecutionStrategy(ExecutionStrategy executionStrategy) {
delegate.setExecutionStrategy(executionStrategy);
}
示例11: GraphQLQueryExecutor
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
private GraphQLQueryExecutor(final GraphQLSchemaHolder graphQLSchemaHolder, final ExecutionStrategy executionStrategy) {
Assert.notNull(graphQLSchemaHolder, "GraphQL Schema holder can not be null");
this.graphQLSchemaHolder = graphQLSchemaHolder;
this.executionStrategy = executionStrategy;
}
示例12: create
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
public static GraphQLQueryExecutor create(final GraphQLSchemaHolder graphQLSchemaHolder, final ExecutionStrategy executionStrategy) {
return new GraphQLQueryExecutor(graphQLSchemaHolder, executionStrategy);
}
示例13: getStrategy
import graphql.execution.ExecutionStrategy; //导入依赖的package包/类
protected ExecutionStrategy getStrategy() {
return new SimpleTraversalStrategy();
}