Sha256: d6312cbc2877aace9afd7f29dac3d4246bb747df352cd1d2cc4b1f159dfb4e77

Contents?: true

Size: 429 Bytes

Versions: 2

Compression:

Stored size: 429 Bytes

Contents

module Kamerling module Server class HTTP
  attr_reader :addr

  def initialize addr: req(:addr)
    @addr = addr
  end

  def join
    thread.join
  end

  def start
    @thread = Thread.new do
      Rack::Handler::WEBrick.run HTTPAPI, Host: addr.host, Port: addr.port
    end
    loop { break if addr.connectable? }
    self
  end

  def stop
    thread.exit.join
  end

  attr_reader :thread
  private     :thread
end end end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kamerling-0.0.2 lib/kamerling/server/http.rb
kamerling-0.0.1 lib/kamerling/server/http.rb