Class: Crawlscope::Crawler

Inherits:
Object
  • Object
show all
Defined in:
lib/crawlscope/crawler.rb

Instance Method Summary collapse

Constructor Details

#initialize(page_fetcher:, concurrency:, fetch_executor: :threaded) ⇒ Crawler

Returns a new instance of Crawler.



5
6
7
8
# File 'lib/crawlscope/crawler.rb', line 5

def initialize(page_fetcher:, concurrency:, fetch_executor: :threaded)
  @page_fetcher = page_fetcher
  @fetch_executor = FetchExecutor.build(name: fetch_executor, concurrency: concurrency)
end

Instance Method Details

#call(urls) ⇒ Object



10
11
12
# File 'lib/crawlscope/crawler.rb', line 10

def call(urls)
  @fetch_executor.call(urls) { |url| fetch(url) }
end