Class: Sponges::Configuration
- Inherits:
-
Object
- Object
- Sponges::Configuration
- Defined in:
- lib/sponges/configuration.rb
Overview
This class concern is to provide a global object for configuration needs.
Constant Summary collapse
- ACCESSOR =
[:worker_name, :worker, :logger, :size, :daemonize, :after_fork, :timeout, :gracefully, :store, :port, :polling, :env ]
Class Method Summary collapse
- .after_fork(&block) ⇒ Object
- .configuration ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .on_chld(&block) ⇒ Object
- .pooling ⇒ Object
- .port ⇒ Object
Class Method Details
.after_fork(&block) ⇒ Object
23 24 25 |
# File 'lib/sponges/configuration.rb', line 23 def after_fork(&block) Hook._after_fork = block end |
.configuration ⇒ Object
17 18 19 20 21 |
# File 'lib/sponges/configuration.rb', line 17 def configuration ACCESSOR.each_with_object({}) do |conf, method| conf[method] = send(method) end end |
.configure {|_self| ... } ⇒ Object
13 14 15 |
# File 'lib/sponges/configuration.rb', line 13 def configure yield self end |
.on_chld(&block) ⇒ Object
27 28 29 |
# File 'lib/sponges/configuration.rb', line 27 def on_chld(&block) Hook._on_chld = block end |
.pooling ⇒ Object
35 36 37 |
# File 'lib/sponges/configuration.rb', line 35 def pooling @pooling || 60 end |
.port ⇒ Object
31 32 33 |
# File 'lib/sponges/configuration.rb', line 31 def port @port || 5032 end |