summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-10-10 14:17:06 -0600
committermo khan <mo@mokhan.ca>2014-10-10 14:17:06 -0600
commit13fd09db3b103bce6d59515b7571897177216546 (patch)
tree058627c46fcfdc612385bb35d9aafa9923ed1ad0
parent76d6eade86d8c7ecc22a1d1be4c2906578262619 (diff)
use named queue using the username as the queue.
-rw-r--r--lib/6-chit-chat/subscribe.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/6-chit-chat/subscribe.rb b/lib/6-chit-chat/subscribe.rb
index c3827c6..327a8d5 100644
--- a/lib/6-chit-chat/subscribe.rb
+++ b/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|