Class: Jackhammer::TopicManager

Inherits:
Object
  • Object
show all
Defined in:
lib/jackhammer/topic_manager.rb

Class Method Summary collapse

Class Method Details

.topicsObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/jackhammer/topic_manager.rb', line 4

def topics
  result = {}
  Jackhammer.configuration.yaml.each do |topic, topic_config|
    fail(InvalidConfigError, "Topic config is invalid") unless topic_config.is_a?(Hash)

    queues = topic_config.delete 'queues'
    result[topic.to_sym] = Topic.new(name: topic, options: topic_config, queue_config: queues)
  end
  result
end