Sha256: cc1654030113021940e48b750db487a73e7ccc0b6c7d474f2375b67c6bd99bec

Contents?: true

Size: 639 Bytes

Versions: 9

Compression:

Stored size: 639 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony/http'
require 'localhost/authority'

app_path = ARGV.first || File.expand_path('./config.ru', __dir__)
app = Polyphony::HTTP::Rack.load(app_path)

authority = Localhost::Authority.fetch
opts = {
  reuse_addr:     true,
  dont_linger:    true,
  secure_context: authority.server_context
}
server = Polyphony::HTTP::Server.listen('0.0.0.0', 1234, opts)
puts 'Listening on port 1234'

child_pids = []
4.times do
  child_pids << Polyphony.fork do
    puts "forked pid: #{Process.pid}"
    server.each(&app)
  end
end

child_pids.each { |pid| EV::Child.new(pid).await }

Version data entries

9 entries across 9 versions & 2 rubygems

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