Commit 13fd09d

mo khan <mo@mokhan.ca>
2014-10-10 20:17:06
use named queue using the username as the queue.
1 parent 76d6ead
Changed files (1)
lib
6-chit-chat
lib/6-chit-chat/subscribe.rb
@@ -6,9 +6,10 @@ require "bunny"
 connection = Bunny.new(host: ENV.fetch('RABBIT_HOST', 'localhost'))
 connection.start
 
+me = `whoami`.chomp!
 channel = connection.create_channel
 exchange = channel.topic("chitchat")
-queue = channel.queue("", exclusive: true)
+queue = channel.queue(me, exclusive: true)
 
 ARGV.push('#') if ARGV.empty?
 ARGV.each do |username|