Skip to content

Commit

Permalink
Update for RabbitMQ Bigwig add-on.
Browse files Browse the repository at this point in the history
  • Loading branch information
quimarche committed Nov 16, 2013
1 parent 94fc187 commit 0b0fe62
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions trudy.rb
Expand Up @@ -12,6 +12,10 @@ class Trudy < Sinatra::Base
PING_SECONDS = 15
QUEUE_NAME = ENV['TRUDY_QUEUE']

def channel
@channel ||= client.create_channel
end

def client
unless @client
@client = Bunny.new(ENV['RABBITMQ_BIGWIG_URL'])
Expand All @@ -21,11 +25,11 @@ def client
end

def exchange
@exchange ||= client.exchange('')
@exchange ||= channel.default_exchange
end

def queue
@queue ||= client.queue(QUEUE_NAME)
@queue ||= channel.queue(QUEUE_NAME, :auto_delete => true)
end

def send_byte_array byte_array
Expand Down

0 comments on commit 0b0fe62

Please sign in to comment.