Sha256: 028b9d850ba5473d09fc5e099e23bf199a6cc0faeb09b82cfc55a971cba91364

Contents?: true

Size: 324 Bytes

Versions: 11

Compression:

Stored size: 324 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'tipi'

$throttler = throttle(1000)
opts = { reuse_addr: true, dont_linger: true }
spin do
  Tipi.serve('0.0.0.0', 1234, opts) do |req|
    $throttler.call { req.respond("Hello world!\n") }
  end
end

puts "pid: #{Process.pid}"
puts 'Listening on port 1234...'

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tipi-0.38 examples/http_server_throttled.rb
tipi-0.37.2 examples/http_server_throttled.rb
tipi-0.37.1 examples/http_server_throttled.rb
tipi-0.37 examples/http_server_throttled.rb
tipi-0.36 examples/http_server_throttled.rb
tipi-0.35 examples/http_server_throttled.rb
tipi-0.34 examples/http_server_throttled.rb
tipi-0.33 examples/http_server_throttled.rb
tipi-0.32 examples/http_server_throttled.rb
tipi-0.31 examples/http_server_throttled.rb
tipi-0.30 examples/http_server_throttled.rb