Module: Rack::Handler::SpiderGazelle

Defined in:
lib/rack/handler/spider-gazelle.rb

Class Method Summary collapse

Class Method Details

.run(app, options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rack/handler/spider-gazelle.rb', line 7

def self.run(app, options = {})
    
    # Replace the rackup with app
    options = ::SpiderGazelle::Options::DEFAULTS.merge(options)
    options.delete(:rackup)
    options[:app] = app

    # Can't pass an object over a pipe
    options[:isolate] = true
    options[:mode] = :thread if options[:mode] == :process

    # Ensure the environment is set
    options[:environment] ||= ENV['RACK_ENV'] || 'development'
    ENV['RACK_ENV'] = options[:environment]

    ::SpiderGazelle::LaunchControl.instance.launch([options])
end