Sha256: 1692c64a5a613fb12311f50567984fabf14cc7e3c9aefb038a074aa367e249c0

Contents?: true

Size: 658 Bytes

Versions: 3

Compression:

Stored size: 658 Bytes

Contents

require "rack"

module Nutcracker
  module Web
    def self.start(nutcracker, options = {})
      @thread = Thread.new do
        Thread.current.abort_on_exception=true
        Rack::Server.start(
          {
            :app => App.new(nutcracker, options[:external_servers] || []),
            :environment => 'production',
            :pid => nil,
            :Port => 9292,
            :Host => '0.0.0.0',
            :AccessLog => []
          }.merge( options )
        )
      end
      self
    end
    
    def self.join
      @thread.join
    end
    
    def self.stop
      @thread.kill
    end

    autoload :App, 'nutcracker/web/app'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nutcracker-web-0.0.11 lib/nutcracker/web.rb
nutcracker-web-0.0.10 lib/nutcracker/web.rb
nutcracker-web-0.0.9 lib/nutcracker/web.rb