magicbus 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/magicbus/publisher.rb +2 -2
- data/lib/magicbus/subscriber.rb +3 -3
- data/lib/magicbus/version.rb +1 -1
- metadata +1 -1
data/lib/magicbus/publisher.rb
CHANGED
@@ -38,8 +38,8 @@ class MagicBus::Publisher
|
|
38
38
|
channel = MagicBus::Subscriber.channels[user_id]
|
39
39
|
|
40
40
|
if channel
|
41
|
-
exchange = channel.
|
42
|
-
exchange.publish(data.to_json
|
41
|
+
exchange = channel.fanout('syme')
|
42
|
+
exchange.publish(data.to_json)
|
43
43
|
end
|
44
44
|
|
45
45
|
end
|
data/lib/magicbus/subscriber.rb
CHANGED
@@ -31,10 +31,10 @@ class MagicBus::Subscriber
|
|
31
31
|
|
32
32
|
channels[user_id] = AMQP::Channel.new(connection)
|
33
33
|
channel = channels[user_id]
|
34
|
+
exchange = channel.fanout('syme')
|
34
35
|
|
35
36
|
queue = channel.queue(user_id, auto_delete: true)
|
36
|
-
|
37
|
-
queue.subscribe do |payload|
|
37
|
+
.bind(exchange).subscribe do |payload|
|
38
38
|
self.clients[user_id].each do |client|
|
39
39
|
client << "data: #{payload}\n\n"
|
40
40
|
end
|
@@ -63,4 +63,4 @@ class MagicBus::Subscriber
|
|
63
63
|
|
64
64
|
end
|
65
65
|
|
66
|
-
end
|
66
|
+
end
|
data/lib/magicbus/version.rb
CHANGED