module BunnyExchanges
Constants
- UndefinedExchange
The required exchange is not defined.
- VERSION
Public Class Methods
BunnyExchanges
configuration
@return [Configuration] the current configuration
# File lib/bunny_exchanges.rb, line 10 def self.configuration @configuration ||= Configuration.new end
A helper to configure BunnyExchanges
@yield [configuration] Configures tenantify
# File lib/bunny_exchanges.rb, line 17 def self.configure yield configuration end
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
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
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