<commit_before>module ActionSubscriber
  module DefaultRouting
    def queues
      @_queues ||= []
    end

    def setup_queue!(method_name, exchange_name)
      queue_name = queue_name_for_method(method_name)
      routing_key_name = routing_key_name_for_method(method_name)

      channel = connection.create_channel
      exchange = channel.topic(exchange_name)
      queue = channel.queue(queue_name)
      queue.bind(exchange, :routing_key => routing_key_name)
      return queue
    end

    def setup_queues!
      exchange_names.each do |exchange_name|
        subscribable_methods.each do |method_name|
          queues << setup_queue!(method_name, exchange_name)
        end
      end
    end
  end
end<commit_msg>change DefaultRouting to generate routes per subscriber<commit_after>module ActionSubscriber
  module DefaultRouting
    def routes
      @routes ||= begin
        routes = []
        exchange_names.each do |exchange_name|
          subscribable_methods.each do |method_name|
            routes << ActionSubscriber::Route.new({
              acknowledgements: acknowledge_messages?,
              action: method_name,
              exchange: exchange_name,
              routing_key: routing_key_name_for_method(method_name),
              subscriber: self,
              queue: queue_name_for_method(method_name),
            })
          end
        end
        routes
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06390449438202248, 'fraction_numerical': 0.0, 'mean_word_length': 2.4926470588235294, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2876070', 'n_tokens_mistral': 401, 'n_tokens_neox': 396, 'n_words': 84}