Class: Anemone::Tentacle
- Inherits:
-
Object
- Object
- Anemone::Tentacle
- Defined in:
- lib/anemone/tentacle.rb
Instance Method Summary collapse
-
#initialize(link_queue, page_queue, opts = {}) ⇒ Tentacle
constructor
Create a new Tentacle.
-
#run ⇒ Object
Gets links from @link_queue, and returns the fetched Page objects into @page_queue.
Constructor Details
Instance Method Details
#run ⇒ Object
Gets links from @link_queue, and returns the fetched Page objects into @page_queue
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/anemone/tentacle.rb', line 20 def run loop do link, from_page = @link_queue.deq break if link == :END @page_queue << @http.fetch_page(link, from_page) delay end end |