Class: Sunshine::Rainbows
- Defined in:
- lib/sunshine/daemons/rainbows.rb
Overview
Simple server wrapper for Rainbows setup and control.
Instance Attribute Summary collapse
-
#concurrency ⇒ Object
readonly
Returns the value of attribute concurrency.
Attributes inherited from Server
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
-
#setup ⇒ Object
Setup Rainbows specific bindings before building its config.
-
#use_concurrency(options = nil) ⇒ Object
Assign and/or use a concurrency model.
Methods inherited from Unicorn
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
#concurrency ⇒ Object (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
#setup ⇒ Object
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 =nil @concurrency ||= {:model => :ThreadSpawn} @concurrency.merge! end |