Sha256: c69ac6f1ae2f656d600f1ea4f90d4316959ef32d5b56168c35ed44824fb84776

Contents?: true

Size: 530 Bytes

Versions: 7

Compression:

Stored size: 530 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony/http'

Exception.__disable_sanitized_backtrace__ = true

TIME_URI = 'https://ui.realiteq.net/'

def get_server_time
  json = Polyphony::HTTP::Agent.get(TIME_URI, query: { q: :time }).json
  puts "*" * 40
  p json
end

X = 1
puts "Making #{X} requests..."
t0 = Time.now
supervise do |s|
  X.times {
    s.spin {
      get_server_time
    }
  }
end
# get_server_time
elapsed = Time.now - t0
puts "count: #{X} elapsed: #{elapsed} rate: #{X / elapsed} reqs/s"

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
polyphony-http-0.28 examples/http_client.rb
polyphony-http-0.27 examples/http_client.rb
polyphony-http-0.26 examples/http_client.rb
polyphony-http-0.25 examples/http_client.rb
polyphony-http-0.24 examples/http_client.rb
polyphony-0.23 examples/http/http_client.rb
polyphony-0.22 examples/http/http_client.rb