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_publish_queue ⇒ Object
- #work_subscribe_queue ⇒ Object
Class Method Details
.attributes ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# 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_publish_queue work_subscribe_queue ) end |
.from_file(file_path) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rabbit_wq/configuration.rb', line 26 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
37 38 39 |
# File 'lib/rabbit_wq/configuration.rb', line 37 def delayed_exchange_prefix @delayed_exchange_prefix || 'work-delay' end |
#delayed_queue_prefix ⇒ Object
41 42 43 |
# File 'lib/rabbit_wq/configuration.rb', line 41 def delayed_queue_prefix @delayed_queue_prefix || 'work-delay' end |
#env ⇒ Object
45 46 47 |
# File 'lib/rabbit_wq/configuration.rb', line 45 def env @env || 'production' end |
#error_queue ⇒ Object
49 50 51 |
# File 'lib/rabbit_wq/configuration.rb', line 49 def error_queue @error_queue || 'work-error' end |
#time_zone ⇒ Object
53 54 55 |
# File 'lib/rabbit_wq/configuration.rb', line 53 def time_zone @time_zone || 'UTC' end |
#work_exchange ⇒ Object
57 58 59 |
# File 'lib/rabbit_wq/configuration.rb', line 57 def work_exchange @work_exchange || 'work' end |
#work_exchange_type ⇒ Object
61 62 63 |
# File 'lib/rabbit_wq/configuration.rb', line 61 def work_exchange_type @work_exchange_type || 'fanout' end |
#work_log_level ⇒ Object
65 66 67 |
# File 'lib/rabbit_wq/configuration.rb', line 65 def work_log_level @work_log_level || 'info' end |
#work_log_path ⇒ Object
69 70 71 |
# File 'lib/rabbit_wq/configuration.rb', line 69 def work_log_path @work_log_path || '/var/log/rabbit-wq/rabbit-wq-work.log' end |
#work_publish_queue ⇒ Object
73 74 75 |
# File 'lib/rabbit_wq/configuration.rb', line 73 def work_publish_queue @work_publish_queue || 'work' end |
#work_subscribe_queue ⇒ Object
77 78 79 |
# File 'lib/rabbit_wq/configuration.rb', line 77 def work_subscribe_queue @work_subscribe_queue || 'work' end |