# File lib/typhoeus/multi.rb, line 5 def initialize @easy_handles = [] end
# File lib/typhoeus/multi.rb, line 13 def add(easy) raise "trying to add easy handle twice" if @easy_handles.include?(easy) easy.set_headers() if easy.headers.empty? multi_add_handle(easy) end
# File lib/typhoeus/multi.rb, line 26 def cleanup() multi_cleanup end
# File lib/typhoeus/multi.rb, line 19 def perform() while active_handle_count > 0 do multi_perform end reset_easy_handles end
# File lib/typhoeus/multi.rb, line 9 def remove(easy) multi_remove_handle(easy) if @easy_handles.include?(easy) end
# File lib/typhoeus/multi.rb, line 30 def reset_easy_handles @easy_handles.dup.each do |easy| multi_remove_handle(easy) yield easy if block_given? end end