class RabbitmqClient::ExchangeRegistry

ExchangeRegistry is a store for all managed exchanges and their details

Public Class Methods

new() click to toggle source
# File lib/rabbitmq_client/exchange_registry.rb, line 15
def initialize
  @exchanges = {}
end

Public Instance Methods

add(name, type, options = {}) click to toggle source
# File lib/rabbitmq_client/exchange_registry.rb, line 19
def add(name, type, options = {})
  @exchanges[name] = Exchange.new(name, type, options)
end
find(name) click to toggle source
# File lib/rabbitmq_client/exchange_registry.rb, line 23
def find(name)
  @exchanges.fetch(name) do
    ActiveSupport::Notifications.instrument(
      'exhange_not_found.rabbitmq_client',
      name: name
    )
    raise ExchangeNotFound, name
  end
end