lib/benchmark/http/command/spider.rb in benchmark-http-0.8.0 vs lib/benchmark/http/command/spider.rb in benchmark-http-0.8.1

- old
+ new

@@ -22,11 +22,11 @@ require_relative '../statistics' require_relative '../links_filter' require 'async' require 'async/http/client' -require 'async/http/url_endpoint' +require 'async/http/endpoint' require 'async/await' require 'samovar' require 'uri' @@ -123,14 +123,14 @@ Async.logger.error("Timeout while fetching #{url}") rescue StandardError Async.logger.error($!) end - async def invoke(parent) + async def call statistics = Statistics.new @urls.each do |url| - endpoint = Async::HTTP::URLEndpoint.parse(url, timeout: 10) + endpoint = Async::HTTP::Endpoint.parse(url, timeout: 10) Async::HTTP::Client.open(endpoint, endpoint.protocol, connection_limit: 4) do |client| fetch(statistics, client, endpoint.url).wait end end