/// <summary> /// 默认参数 /// </summary> public Crawler() { _crawler = new CrawlerManager(10); }
/// <summary> /// 指定参数构造 /// </summary> /// <param name="crawlOptions"></param> public Crawler(CrawlOptions crawlOptions) { _crawler = new CrawlerManager(crawlOptions.MaxCrawlThread); _crawler.InitCrawThread(); }
/// <summary> /// 构造函数(为线程的采集主体赋值) /// </summary> /// <param name="Linker"></param> public CrawlThread(CrawlerManager crawler) { _thread = new Thread(DoWork); _thread.IsBackground = true; _crawler = crawler; }