Sha256: 83db768c3b79b8e0f086dc642081508ee1f7d5c3abd5b55890f7965883a1bd2a

Contents?: true

Size: 727 Bytes

Versions: 1

Compression:

Stored size: 727 Bytes

Contents

require "unicorn"

module Unicorn
  module Rails
    require "unicorn/rails/version"
  end
end

module Rack
  module Handler
    class Unicorn
      class << self
        def run(app, options = {})
          unicorn_options = {}
          unicorn_options[:listeners] = ["#{options[:Host]}:#{options[:Port]}"]
          unicorn_options[:worker_processes] = 1
          unicorn_options[:timeout] = 31 * 24 * 60 * 60

          ::Unicorn::Launcher.daemonize!(unicorn_options) if options[:daemonize]
          ::Unicorn::HttpServer.new(app, unicorn_options).start.join
        end
      end
    end

    register "unicorn", "Rack::Handler::Unicorn"

    def self.default(options = {})
     Rack::Handler::Unicorn
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unicorn-rails-1.0.0 lib/unicorn/rails.rb