445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
# File 'lib/cocoapods-core/cdn_source.rb', line 445
def download_typhoeus_impl_async(file_remote_url, etag)
require 'typhoeus'
request = Typhoeus::Request.new(
file_remote_url,
:method => :get,
:http_version => :httpv2_0,
:timeout => 10,
:connecttimeout => 10,
:accept_encoding => 'gzip',
:netrc => :optional,
:netrc_file => Netrc.default_path,
:headers => etag.nil? ? {} : { 'If-None-Match' => etag },
)
future = Promises.resolvable_future_on(HYDRA_EXECUTOR)
queue_request(request)
request.on_complete do |response|
future.fulfill(response)
end
future
end
|