module BunnyExchanges

Constants

UndefinedExchange

The required exchange is not defined.

VERSION

Public Class Methods

configuration() click to toggle source

BunnyExchanges configuration

@return [Configuration] the current configuration

# File lib/bunny_exchanges.rb, line 10
def self.configuration
  @configuration ||= Configuration.new
end
configure() { |configuration| ... } click to toggle source

A helper to configure BunnyExchanges

@yield [configuration] Configures tenantify

# File lib/bunny_exchanges.rb, line 17
def self.configure
  yield configuration
end
get(action, connection_name: :default) click to toggle source

Delegates `#get` to the current manager. Returns the required exchange.

@param [Symbol, Hash] the action name and the connection_name @return [Bunny::Exchange] the required exchange. @raise [BunnyExchanges::UndefinedExchange] when the required example is not defined. @see Tenant.using

# File lib/bunny_exchanges.rb, line 28
def self.get action, connection_name: :default
  manager.get(action, connection_name)
end
manager() click to toggle source

The current instance of {BunnyExchanges::Manager}.

@return [BunnyExchanges::Manager] the manager with the current configuration. @see Tenant.using

# File lib/bunny_exchanges.rb, line 42
def self.manager
  @manager ||= Manager.new(configuration)
end
reset!() click to toggle source

Removes the current manager and starts a new one with the same configuration. Useful after forking or in any situation where a reconnection is needed.

# File lib/bunny_exchanges.rb, line 34
def self.reset!
  @manager = nil
end