Sha256: 0fb73ba546e0f501e3d561649b37b5045d73abeae6a4c1b594b2c79731403e16

Contents?: true

Size: 477 Bytes

Versions: 23

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'tipi'

::Exception.__disable_sanitized_backtrace__ = true

opts = {
  reuse_addr:     true,
  reuse_port:     true,
  dont_linger:    true
}

server = Tipi.listen('0.0.0.0', 1234, opts)

puts 'Listening on port 1234'

throttler = Polyphony::Throttler.new(interval: 5)
server.accept_loop do |socket|
  throttler.call do
    spin { Tipi.client_loop(socket, opts) { |req| req.respond("Hello world!\n") } }
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
tipi-0.55 examples/http_server_throttled_accept.rb
tipi-0.54 examples/http_server_throttled_accept.rb
tipi-0.53 examples/http_server_throttled_accept.rb
tipi-0.52 examples/http_server_throttled_accept.rb
tipi-0.51 examples/http_server_throttled_accept.rb
tipi-0.50 examples/http_server_throttled_accept.rb
tipi-0.49 examples/http_server_throttled_accept.rb
tipi-0.47 examples/http_server_throttled_accept.rb
tipi-0.46 examples/http_server_throttled_accept.rb
tipi-0.45 examples/http_server_throttled_accept.rb
tipi-0.43 examples/http_server_throttled_accept.rb
tipi-0.42 examples/http_server_throttled_accept.rb
tipi-0.41 examples/http_server_throttled_accept.rb
tipi-0.40 examples/http_server_throttled_accept.rb
tipi-0.39 examples/http_server_throttled_accept.rb
tipi-0.38 examples/http_server_throttled_accept.rb
tipi-0.37.2 examples/http_server_throttled_accept.rb
tipi-0.37.1 examples/http_server_throttled_accept.rb
tipi-0.37 examples/http_server_throttled_accept.rb
tipi-0.36 examples/http_server_throttled_accept.rb