Class: SimpleRabbit::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_rabbit/connection.rb

Class Method Summary collapse

Class Method Details

.get(opts = {}) ⇒ Object



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

def self.get(opts = {})
  $simplerabbit_connection ||=
    begin
      conn = Bunny.new(opts)
      conn.start
      conn
    end
  $simplerabbit_channel ||= $simplerabbit_connection.create_channel
end