Class: Outboxable::Connection
- Inherits:
-
Object
- Object
- Outboxable::Connection
- Includes:
- Singleton
- Defined in:
- lib/outboxable/connection.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #channel ⇒ Object
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/outboxable/connection.rb', line 8 def initialize @connection = Bunny.new( host: Outboxable.configuration.rabbitmq_host, port: Outboxable.configuration.rabbitmq_port, user: Outboxable.configuration.rabbitmq_user, password: Outboxable.configuration.rabbitmq_password, vhost: Outboxable.configuration.rabbitmq_vhost ) @connection.start end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
6 7 8 |
# File 'lib/outboxable/connection.rb', line 6 def connection @connection end |
Instance Method Details
#channel ⇒ Object
20 21 22 23 24 |
# File 'lib/outboxable/connection.rb', line 20 def channel @channel ||= ConnectionPool.new do connection.create_channel end end |