Пример #1
0
 public Scraper(IScraperQueue scraperQueue, ICrawlLogger crawlLogger, AsyncManualResetEvent manualResetEvent,
                CancellationToken cancellationToken)
 {
     _scraperQueue      = scraperQueue ?? throw new ArgumentNullException(nameof(scraperQueue));
     _crawlLogger       = crawlLogger ?? throw new ArgumentNullException(nameof(crawlLogger));
     _manualResetEvent  = manualResetEvent ?? throw new ArgumentNullException(nameof(manualResetEvent));
     _cancellationToken = cancellationToken;
 }
Пример #2
0
 public ScraperDequeuer(ILogger <ScraperDequeuer> logger,
                        IServiceProvider serviceProvider, IScraperQueue queue, IBrowserService browserService)
 {
     _logger          = logger;
     _queue           = queue;
     _serviceProvider = serviceProvider;
     _browserService  = browserService;
 }
Пример #3
0
        public ScrapingSheduler(IServiceProvider services, ILogger <ScrapingSheduler> logger, IScraperQueue queue)
        {
            Services = services;

            _logger   = logger;
            _schedule = CrontabSchedule.Parse(Schedule);
            _nextRun  = _schedule.GetNextOccurrence(DateTime.Now);
            _queue    = queue;
        }
 public ScraperFactory(IScraperQueue scraperQueue, ICrawlLogger crawlLogger)
 {
     _scraperQueue = scraperQueue ?? throw new ArgumentNullException(nameof(scraperQueue));
     _crawlLogger  = crawlLogger ?? throw new ArgumentNullException(nameof(crawlLogger));
 }