Class: SidekiqAlive::Config
- Inherits:
-
Object
- Object
- SidekiqAlive::Config
- Includes:
- Singleton
- Defined in:
- lib/sidekiq_alive/config.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#custom_liveness_probe ⇒ Object
Returns the value of attribute custom_liveness_probe.
-
#host ⇒ Object
Returns the value of attribute host.
-
#liveness_key ⇒ Object
Returns the value of attribute liveness_key.
-
#path ⇒ Object
Returns the value of attribute path.
-
#port ⇒ Object
Returns the value of attribute port.
-
#queue_prefix ⇒ Object
Returns the value of attribute queue_prefix.
-
#registered_instance_key ⇒ Object
Returns the value of attribute registered_instance_key.
-
#server ⇒ Object
Returns the value of attribute server.
-
#time_to_live ⇒ Object
Returns the value of attribute time_to_live.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #registration_ttl ⇒ Object
- #set_defaults ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
18 19 20 |
# File 'lib/sidekiq_alive/config.rb', line 18 def initialize set_defaults end |
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def callback @callback end |
#custom_liveness_probe ⇒ Object
Returns the value of attribute custom_liveness_probe.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def custom_liveness_probe @custom_liveness_probe end |
#host ⇒ Object
Returns the value of attribute host.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def host @host end |
#liveness_key ⇒ Object
Returns the value of attribute liveness_key.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def liveness_key @liveness_key end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def path @path end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def port @port end |
#queue_prefix ⇒ Object
Returns the value of attribute queue_prefix.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def queue_prefix @queue_prefix end |
#registered_instance_key ⇒ Object
Returns the value of attribute registered_instance_key.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def registered_instance_key @registered_instance_key end |
#server ⇒ Object
Returns the value of attribute server.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def server @server end |
#time_to_live ⇒ Object
Returns the value of attribute time_to_live.
7 8 9 |
# File 'lib/sidekiq_alive/config.rb', line 7 def time_to_live @time_to_live end |
Instance Method Details
#registration_ttl ⇒ Object
35 36 37 |
# File 'lib/sidekiq_alive/config.rb', line 35 def registration_ttl @registration_ttl || time_to_live + 60 end |
#set_defaults ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/sidekiq_alive/config.rb', line 22 def set_defaults @host = ENV.fetch('SIDEKIQ_ALIVE_HOST', '0.0.0.0') @port = ENV.fetch('SIDEKIQ_ALIVE_PORT', 7433) @path = ENV.fetch('SIDEKIQ_ALIVE_PATH', '/') @liveness_key = 'SIDEKIQ::LIVENESS_PROBE_TIMESTAMP' @time_to_live = 10 * 60 @callback = proc {} @registered_instance_key = 'SIDEKIQ_REGISTERED_INSTANCE' @queue_prefix = :sidekiq_alive @server = ENV.fetch('SIDEKIQ_ALIVE_SERVER', 'webrick') @custom_liveness_probe = proc { true } end |