Sha256: 07508297b8195673232ac4cd0a4e4ef487ea90f23225ffbce90e4388395498ea

Contents?: true

Size: 362 Bytes

Versions: 15

Compression:

Stored size: 362 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'tipi'

$throttler = Polyphony::Throttler.new(1000)
opts = { reuse_addr: true, dont_linger: true }
server = 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...'
server.await

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tipi-0.55 examples/http_server_throttled.rb
tipi-0.54 examples/http_server_throttled.rb
tipi-0.53 examples/http_server_throttled.rb
tipi-0.52 examples/http_server_throttled.rb
tipi-0.51 examples/http_server_throttled.rb
tipi-0.50 examples/http_server_throttled.rb
tipi-0.49 examples/http_server_throttled.rb
tipi-0.47 examples/http_server_throttled.rb
tipi-0.46 examples/http_server_throttled.rb
tipi-0.45 examples/http_server_throttled.rb
tipi-0.43 examples/http_server_throttled.rb
tipi-0.42 examples/http_server_throttled.rb
tipi-0.41 examples/http_server_throttled.rb
tipi-0.40 examples/http_server_throttled.rb
tipi-0.39 examples/http_server_throttled.rb