Class: Sunshine::Rainbows

Inherits:
Unicorn show all
Defined in:
lib/sunshine/daemons/rainbows.rb

Overview

Simple server wrapper for Rainbows setup and control.

Instance Attribute Summary collapse

Attributes inherited from Server

#port, #server_name, #sigkill

Attributes inherited from Daemon

#app, #bin, #config_file, #config_path, #config_template, #name, #pid, #processes, #restart_cmd, #server_apps, #start_cmd, #status_cmd, #stop_cmd, #sudo, #target, #timeout

Instance Method Summary collapse

Methods inherited from Unicorn

#initialize, #start_cmd

Methods inherited from Server

binder_methods, #initialize, passenger_root, #stop_cmd, #supports_rack?, #use_passenger?

Methods inherited from Daemon

binder_methods, #config_file_path, #config_template_files, #each_server_app, #has_setup?, #initialize, #log_file, #log_files, #restart, #start, #stop, underscore, #upload_config_files

Constructor Details

This class inherits a constructor from Sunshine::Unicorn

Instance Attribute Details

#concurrencyObject (readonly)

Returns the value of attribute concurrency.



8
9
10
# File 'lib/sunshine/daemons/rainbows.rb', line 8

def concurrency
  @concurrency
end

Instance Method Details

#setupObject

Setup Rainbows specific bindings before building its config.



27
28
29
30
31
32
33
# File 'lib/sunshine/daemons/rainbows.rb', line 27

def setup
  super do |server_app, binder|
    binder.forward :concurrency

    yield(server_app, binder) if block_given?
  end
end

#use_concurrency(options = nil) ⇒ Object

Assign and/or use a concurrency model. Supports all Rainbows concurrency models; defaults to :ThreadSpawn Allows options:

:model

:ConcurrModel - concurrency model. Defaults to ThreadSpawn

:connections

int - the number of worker connections to use.

:timeout

seconds - the keepalive timeout. zero disables keepalives.



18
19
20
21
# File 'lib/sunshine/daemons/rainbows.rb', line 18

def use_concurrency options=nil
  @concurrency ||= {:model => :ThreadSpawn}
  @concurrency.merge! options
end