diff options
| author | mo khan <mo@mokhan.ca> | 2014-10-10 14:17:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-10-10 14:17:06 -0600 |
| commit | 13fd09db3b103bce6d59515b7571897177216546 (patch) | |
| tree | 058627c46fcfdc612385bb35d9aafa9923ed1ad0 | |
| parent | 76d6eade86d8c7ecc22a1d1be4c2906578262619 (diff) | |
use named queue using the username as the queue.
| -rw-r--r-- | lib/6-chit-chat/subscribe.rb | 3 |
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| |
