class NapaRabbitPublisher::AMQPSingleton

Attributes

channel[R]
connection[R]
exchange[R]

Public Class Methods

new() click to toggle source

we only want one connection at a time (most of the time) to RabbitMQ

# File lib/napa_rabbit_publisher/amqp_singleton.rb, line 7
def initialize
  @connection = Bunny.new(ENV['AMQP_HOST'])
  @connection.start
  @channel = connection.create_channel
  @exchange = channel.topic(ENV['SERVICE_NAME'])
end