class MicroBunny::Connection

Attributes

conn[R]

Public Class Methods

new(adapter:, host:, vhost: nil, username: 'guest', password: 'guest') click to toggle source
# File lib/microbunny/connection.rb, line 3
def initialize(adapter:, host:, vhost: nil, username: 'guest', password: 'guest')
  @conn = adapter.new(
    host,
    vhost: vhost,
    username: username,
    password: password,
    continuation_timeout: 10000
  )
  conn.start
end

Public Instance Methods

channel() click to toggle source
# File lib/microbunny/connection.rb, line 14
def channel
  @channel ||= conn.create_channel
end
stop() click to toggle source
# File lib/microbunny/connection.rb, line 18
def stop
  conn.close
end