public ScanSubBatchCommandHandler(
            IDateTimeProvider dateTimeProvider,
            ISubScanningService subScanningService,
            ISubWriteRepository subWriteRepository,
            IOptions <ScanSubBatchOptions> options,
            ISteamPageFactory steamPageFactory,
            ILogger <ScanSubBatchCommandHandler> logger)
        {
            if (options is null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (options.Value is null)
            {
                throw new ArgumentException(
                          "The provided configuration object does not contain valid settings for sub batch processing.",
                          nameof(options));
            }

            this.dateTimeProvider   = dateTimeProvider ?? throw new ArgumentNullException(nameof(dateTimeProvider));
            this.subScanningService = subScanningService ?? throw new ArgumentNullException(nameof(subScanningService));
            this.subWriteRepository = subWriteRepository ?? throw new ArgumentNullException(nameof(subWriteRepository));
            this.steamPageFactory   = steamPageFactory ?? throw new ArgumentNullException(nameof(steamPageFactory));
            this.logger             = logger ?? throw new ArgumentNullException(nameof(logger));

            degreeOfParallelism = options.Value.DegreeOfParallelism;

            logger.LogInformation("Using degree of parallelism: {@DegreeOfParallelism}", degreeOfParallelism);
        }
Example #2
0
        public SubAggregationService(
            IDateTimeProvider dateTimeProvider,
            IRedisConnectionWrapper redisConnectionWrapper,
            ISubQueryRepository subQueryRepository,
            ISubWriteRepository subWriteRepository)
        {
            if (redisConnectionWrapper is null)
            {
                throw new ArgumentNullException(nameof(redisConnectionWrapper));
            }

            redisDatabase = redisConnectionWrapper.ConnectionMultiplexer.GetDatabase();

            this.subQueryRepository = subQueryRepository ?? throw new ArgumentNullException(nameof(subQueryRepository));
            this.dateTimeProvider   = dateTimeProvider ?? throw new ArgumentNullException(nameof(dateTimeProvider));
            this.subWriteRepository = subWriteRepository ?? throw new ArgumentNullException(nameof(subWriteRepository));
        }
 public ExplorePageCommandHandler(
     IDateTimeProvider dateTimeProvider,
     ILogger <ExplorePageCommandHandler> logger,
     ICrawlerAddressRegistrationService crawlerAddressRegistrationService,
     ICrawlerPrefetchService crawlerPrefetchService,
     IAppWriteRepository appRepository,
     IBundleWriteRepository bundleRepository,
     ISubWriteRepository subWriteRepository)
 {
     this.dateTimeProvider = dateTimeProvider ?? throw new ArgumentNullException(nameof(dateTimeProvider));
     this.logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     this.crawlerAddressRegistrationService = crawlerAddressRegistrationService ?? throw new ArgumentNullException(nameof(crawlerAddressRegistrationService));
     this.crawlerPrefetchService            = crawlerPrefetchService ?? throw new ArgumentNullException(nameof(crawlerPrefetchService));
     this.appRepository      = appRepository ?? throw new ArgumentNullException(nameof(appRepository));
     this.bundleRepository   = bundleRepository ?? throw new ArgumentNullException(nameof(bundleRepository));
     this.subWriteRepository = subWriteRepository ?? throw new ArgumentNullException(nameof(subWriteRepository));
 }