Class: Sunshine::Rainbows
- Defined in:
- lib/sunshine/daemons/rainbows.rb
Overview
Simple server wrapper for Rainbows setup and control. Rainbows is strictly a backend server and therefore does not support the :point_to proxying option.
Constant Summary
Constants inherited from Daemon
Daemon::RESTART_FAILED_CODE, Daemon::START_FAILED_CODE, Daemon::STATUS_DOWN_CODE, Daemon::STOP_FAILED_CODE
Instance Attribute Summary collapse
-
#concurrency ⇒ Object
readonly
Returns the value of attribute concurrency.
Attributes inherited from Server
#cluster, #connections, #port, #server_name, #sigkill, #target
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, #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, new_cluster, passenger_root, #supports_passenger?, #supports_rack?, #use_passenger?
Methods inherited from Daemon
#_restart_cmd, #_start_cmd, #_status_cmd, #_stop_cmd, binder_methods, #chown_log_files, #config_binding, #config_file_path, #config_template_files, #configure_remote_dirs, #each_server_app, #exit_on_failure, #has_setup?, #initialize, #log_file, #log_files, #pick_sudo, #register_after_user_script, #restart, short_name, #start, #status, #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.
10 11 12 |
# File 'lib/sunshine/daemons/rainbows.rb', line 10 def concurrency @concurrency end |
Instance Method Details
#setup ⇒ Object
Setup Rainbows specific bindings before building its config.
29 30 31 32 33 34 35 |
# File 'lib/sunshine/daemons/rainbows.rb', line 29 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.
20 21 22 23 |
# File 'lib/sunshine/daemons/rainbows.rb', line 20 def use_concurrency =nil @concurrency ||= {:model => :ThreadSpawn} @concurrency.merge! end |