예제 #1
0
        private ProcessEngine(ProcessEngineOptions options)
        {
            _options           = options;
            _cancellationToken = _cancellation.Token;
            _cancellationToken.Register(() => { Logger.Info("正在取消任务..."); });

            _novelInfoRepository    = new NovelInfoRepository();
            _novelIndexRepository   = new NovelIndexRepository();
            _novelChapterRepository = new NovelChapterRepository();
        }
예제 #2
0
 public static ProcessEngine Create(ProcessEngineOptions options = null)
 {
     if (_instance == null)
     {
         lock (_obj)
         {
             if (_instance == null)
             {
                 _instance = new ProcessEngine(options ?? new ProcessEngineOptions());
             }
         }
     }
     return(_instance);
 }
예제 #3
0
        public Spider(ProcessEngineOptions option, RuleModel rule)
        {
            _rule = rule;

            _novelSorts = ConfigurationManager.GetSection <List <NovelSortSettings> >("SpiderSettings:NovelSort");
        }