Class: Rabbitek::Config
- Inherits:
-
Object
- Object
- Rabbitek::Config
- Defined in:
- lib/rabbitek/config.rb
Overview
Rabbitek configuration
Constant Summary collapse
- DEFAULTS =
{ bunny_configuration: { hosts: 'localhost:5672', vhost: '/' }, log_format: 'json', enable_newrelic: true, enable_sentry: true, logger: Logger.new(STDOUT), reloader: proc { |&block| block.call } }.freeze
Instance Method Summary collapse
- #add_client_hook(hook_object, position = @client_hooks_config.size) ⇒ Object
- #add_server_hook(hook_object, position = @server_hooks_config.size) ⇒ Object
- #client_hooks ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #server_hooks ⇒ Object
Constructor Details
Instance Method Details
#add_client_hook(hook_object, position = @client_hooks_config.size) ⇒ Object
25 26 27 |
# File 'lib/rabbitek/config.rb', line 25 def add_client_hook(hook_object, position = @client_hooks_config.size) @client_hooks_config.insert(position, hook_object) end |
#add_server_hook(hook_object, position = @server_hooks_config.size) ⇒ Object
29 30 31 |
# File 'lib/rabbitek/config.rb', line 29 def add_server_hook(hook_object, position = @server_hooks_config.size) @server_hooks_config.insert(position, hook_object) end |
#client_hooks ⇒ Object
33 34 35 36 37 38 |
# File 'lib/rabbitek/config.rb', line 33 def client_hooks @client_hooks ||= begin @client_hooks_config << Client::Hooks::OpenTracing.new @client_hooks_config.reverse end end |
#server_hooks ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/rabbitek/config.rb', line 40 def server_hooks @server_hooks ||= begin @server_hooks_config.unshift(Server::Hooks::TimeTracker.new) @server_hooks_config.push(Server::Hooks::OpenTracing.new, Server::Hooks::Retry.new) @server_hooks_config.reverse end end |