Sha256: e9fd5b74454d946bd8ad77773a99afaa15331b98ac187ec6a48962ffc6ff5cc6

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 Bytes

Contents

module UnicornRails
  require "unicorn-rails/version"
end

require "unicorn"

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] = 3

          if options[:debugger]
            unicorn_options[:worker_processes] = 1
            unicorn_options[:timeout] = 120
          end

          ::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-0.0.1 lib/unicorn-rails.rb