Class: RabbitWQ::Configuration
- Inherits:
-
Object
- Object
- RabbitWQ::Configuration
- Defined in:
- lib/rabbit_wq/configuration.rb
Class Method Summary collapse
Instance Method Summary collapse
- #delayed_exchange_prefix ⇒ Object
- #delayed_queue_prefix ⇒ Object
- #env ⇒ Object
- #error_queue ⇒ Object
- #time_zone ⇒ Object
- #work_exchange ⇒ Object
- #work_exchange_type ⇒ Object
- #work_log_level ⇒ Object
- #work_log_path ⇒ Object
- #work_queue ⇒ Object
Class Method Details
.attributes ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rabbit_wq/configuration.rb', line 6 def self.attributes %w( delayed_exchange_prefix delayed_queue_prefix environment_file_path env error_queue threads time_zone work_exchange work_exchange_type work_log_level work_log_path work_queue ) end |
.from_file(file_path) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rabbit_wq/configuration.rb', line 25 def self.from_file( file_path ) = Oj.load( File.read( file_path )) RabbitWQ.configuration = Configuration.new attributes.each do |c| if [c] RabbitWQ.configuration.send( :"#{c}=", [c] ) end end end |
Instance Method Details
#delayed_exchange_prefix ⇒ Object
36 37 38 |
# File 'lib/rabbit_wq/configuration.rb', line 36 def delayed_exchange_prefix @delayed_exchange_prefix || 'work-delay' end |
#delayed_queue_prefix ⇒ Object
40 41 42 |
# File 'lib/rabbit_wq/configuration.rb', line 40 def delayed_queue_prefix @delayed_queue_prefix || 'work-delay' end |
#env ⇒ Object
44 45 46 |
# File 'lib/rabbit_wq/configuration.rb', line 44 def env @env || 'production' end |
#error_queue ⇒ Object
48 49 50 |
# File 'lib/rabbit_wq/configuration.rb', line 48 def error_queue @error_queue || 'work-error' end |
#time_zone ⇒ Object
52 53 54 |
# File 'lib/rabbit_wq/configuration.rb', line 52 def time_zone @time_zone || 'UTC' end |
#work_exchange ⇒ Object
56 57 58 |
# File 'lib/rabbit_wq/configuration.rb', line 56 def work_exchange @work_exchange || 'work' end |
#work_exchange_type ⇒ Object
60 61 62 |
# File 'lib/rabbit_wq/configuration.rb', line 60 def work_exchange_type @work_exchange_type || 'fanout' end |
#work_log_level ⇒ Object
64 65 66 |
# File 'lib/rabbit_wq/configuration.rb', line 64 def work_log_level @work_log_level || 'info' end |
#work_log_path ⇒ Object
68 69 70 |
# File 'lib/rabbit_wq/configuration.rb', line 68 def work_log_path @work_log_path || '/var/log/rabbit-wq/rabbit-wq-work.log' end |
#work_queue ⇒ Object
72 73 74 |
# File 'lib/rabbit_wq/configuration.rb', line 72 def work_queue @work_queue || 'work' end |