public RequestTimeoutMiddleware(
     QueryDelegate next,
     IRequestTimeoutOptionsAccessor options)
 {
     _next = next
             ?? throw new ArgumentNullException(nameof(next));
     _options = options ??
                throw new ArgumentNullException(nameof(options));
 }
 public SubscriptionExecutionStrategy(
     IRequestTimeoutOptionsAccessor options)
 {
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     _options = options;
 }
Exemple #3
0
        public static IQueryExecutionBuilder UseRequestTimeout(
            this IQueryExecutionBuilder builder,
            IRequestTimeoutOptionsAccessor options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            builder.Services.AddSingleton(options);

            return(builder.Use <RequestTimeoutMiddleware>());
        }
 public ExecutionStrategyResolver(
     IRequestTimeoutOptionsAccessor options)
 {
     _strategies = new Dictionary <OperationType, IExecutionStrategy>()
     {
         {
             OperationType.Query,
             new QueryExecutionStrategy()
         },
         {
             OperationType.Mutation,
             new MutationExecutionStrategy()
         },
         {
             OperationType.Subscription,
             new SubscriptionExecutionStrategy(options)
         }
     };
 }