Module: BunnyExchanges
- Defined in:
- lib/bunny_exchanges.rb,
lib/bunny_exchanges/manager.rb,
lib/bunny_exchanges/version.rb,
lib/bunny_exchanges/configuration.rb
Defined Under Namespace
Classes: Configuration, Manager
Constant Summary collapse
- UndefinedExchange =
The required exchange is not defined.
Class.new(StandardError)
- VERSION =
"0.2.0"
Class Method Summary collapse
-
.configuration ⇒ Configuration
BunnyExchanges configuration.
-
.configure {|configuration| ... } ⇒ Object
A helper to configure BunnyExchanges.
-
.get(action, connection_name: :default) ⇒ Bunny::Exchange
Delegates ‘#get` to the current manager.
-
.manager ⇒ BunnyExchanges::Manager
The current instance of Manager.
-
.reset! ⇒ Object
Removes the current manager and starts a new one with the same configuration.
Class Method Details
.configuration ⇒ Configuration
BunnyExchanges configuration
10 11 12 |
# File 'lib/bunny_exchanges.rb', line 10 def self.configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
A helper to configure BunnyExchanges
17 18 19 |
# File 'lib/bunny_exchanges.rb', line 17 def self.configure yield configuration end |
.get(action, connection_name: :default) ⇒ Bunny::Exchange
Delegates ‘#get` to the current manager. Returns the required exchange.
28 29 30 |
# File 'lib/bunny_exchanges.rb', line 28 def self.get action, connection_name: :default manager.get(action, connection_name) end |
.manager ⇒ BunnyExchanges::Manager
The current instance of Manager.
42 43 44 |
# File 'lib/bunny_exchanges.rb', line 42 def self.manager @manager ||= Manager.new(configuration) end |
.reset! ⇒ Object
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.
34 35 36 |
# File 'lib/bunny_exchanges.rb', line 34 def self.reset! @manager = nil end |