class Freddy::Adapters::BunnyAdapter

Constants

DEFAULT_OPTIONS

Public Class Methods

connect(config) click to toggle source
# File lib/freddy/adapters/bunny_adapter.rb, line 15
def self.connect(config)
  bunny = Bunny.new(DEFAULT_OPTIONS.merge(config))
  bunny.start
  new(bunny)
end
new(bunny) click to toggle source
# File lib/freddy/adapters/bunny_adapter.rb, line 21
def initialize(bunny)
  @bunny = bunny
end

Public Instance Methods

close() click to toggle source
# File lib/freddy/adapters/bunny_adapter.rb, line 31
def close
  @bunny.close
end
create_channel(prefetch: nil) click to toggle source
# File lib/freddy/adapters/bunny_adapter.rb, line 25
def create_channel(prefetch: nil)
  bunny_channel = @bunny.create_channel
  bunny_channel.prefetch(prefetch) if prefetch
  Channel.new(bunny_channel)
end