class Lapine::Consumer::Connection
Attributes
channel[R]
connection[R]
exchange[R]
Public Class Methods
new(config, topic)
click to toggle source
# File lib/lapine/consumer/connection.rb, line 9 def initialize(config, topic) @connection = AMQP.connect(config.connection_properties) @channel = AMQP::Channel.new(connection) @exchange = AMQP::Exchange.new(channel, :topic, topic, durable: true) end
Public Instance Methods
close!()
click to toggle source
# File lib/lapine/consumer/connection.rb, line 15 def close! @connection.close if @connection.connected? end