Class: Typhoeus::Multi
- Inherits:
-
Object
- Object
- Typhoeus::Multi
- Defined in:
- lib/typhoeus/multi.rb,
ext/typhoeus/typhoeus_multi.c
Instance Attribute Summary collapse
-
#easy_handles ⇒ Object
readonly
Returns the value of attribute easy_handles.
Instance Method Summary collapse
- #add(easy) ⇒ Object
- #cleanup ⇒ Object
-
#initialize ⇒ Multi
constructor
A new instance of Multi.
- #perform ⇒ Object
- #remove(easy) ⇒ Object
Constructor Details
#initialize ⇒ Multi
Returns a new instance of Multi.
5 6 7 |
# File 'lib/typhoeus/multi.rb', line 5 def initialize reset_easy_handles end |
Instance Attribute Details
#easy_handles ⇒ Object (readonly)
Returns the value of attribute easy_handles.
3 4 5 |
# File 'lib/typhoeus/multi.rb', line 3 def easy_handles @easy_handles end |
Instance Method Details
#add(easy) ⇒ Object
13 14 15 16 17 |
# File 'lib/typhoeus/multi.rb', line 13 def add(easy) easy.set_headers() if easy.headers.empty? @easy_handles << easy multi_add_handle(easy) end |
#cleanup ⇒ Object
26 27 28 |
# File 'lib/typhoeus/multi.rb', line 26 def cleanup() multi_cleanup end |
#perform ⇒ Object
19 20 21 22 23 24 |
# File 'lib/typhoeus/multi.rb', line 19 def perform() while active_handle_count > 0 do multi_perform end reset_easy_handles end |
#remove(easy) ⇒ Object
9 10 11 |
# File 'lib/typhoeus/multi.rb', line 9 def remove(easy) multi_remove_handle(easy) end |