public CheckRequestStatusJob(IPendingOperationsService pendingOperationsService, IDateTimeProvider dateTimeProvider,
                                     RequestsOptions requestsOptions, ILogger <CheckRequestStatusJob> logger, IQoSViolateRaiser qoSViolateRaiser)
        {
            _pendingOperationsService = pendingOperationsService;
            _dateTimeProvider         = dateTimeProvider;
            _logger           = logger;
            _qoSViolateRaiser = qoSViolateRaiser;

            _handlingRequestsOvertimeInSeconds = requestsOptions.MaxHandlingOperationSeconds;
        }
 public OperationsService(IDistributedCache cache, RequestsOptions options)
 {
     _cache   = cache;
     _options = options;
 }
Esempio n. 3
0
 public OperationsService(IDistributedCache cache, IPendingOperationsService pendingOperationsService, RequestsOptions options)
 {
     _cache = cache;
     _pendingOperationsService = pendingOperationsService;
     _options = options;
 }
        public static IServiceCollection AddQoSViolationChecker(this IServiceCollection services, RequestsOptions requestsOptions)
        {
            services
            .AddSingleton <IPendingOperationsService, PendingOperationsService>()
            .AddSingleton <CheckRequestStatusJob>()
            .AddSingleton(new JobSchedule(
                              jobType: typeof(CheckRequestStatusJob),
                              cronExpression: requestsOptions.CheckRequestCronExpression));

            return(services);
        }