Class: RabbitFeed::Connection

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/rabbit_feed/connection.rb

Direct Known Subclasses

ConsumerConnection, ProducerConnection

Instance Method Summary collapse

Constructor Details

#initializeConnection

Returns a new instance of Connection.



5
6
7
8
9
10
11
12
# File 'lib/rabbit_feed/connection.rb', line 5

def initialize
  RabbitFeed.log.info { { event: :connecting_to_rabbitmq, options: RabbitFeed.configuration.connection_options.merge(password: :redacted, logger: :redacted) } }
  @connection = Bunny.new RabbitFeed.configuration.connection_options
  @connection.start
  RabbitFeed.log.info { { event: :connected_to_rabbitmq } }
  @channel = @connection.create_channel
  @mutex = Mutex.new
end