magicbus 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,8 +38,8 @@ class MagicBus::Publisher
38
38
  channel = MagicBus::Subscriber.channels[user_id]
39
39
 
40
40
  if channel
41
- exchange = channel.exchange('syme', type: 'fanout')
42
- exchange.publish(data.to_json, routing_key: user_id)
41
+ exchange = channel.fanout('syme')
42
+ exchange.publish(data.to_json)
43
43
  end
44
44
 
45
45
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module MagicBus
2
2
 
3
- VERSION = '0.0.5'
3
+ VERSION = '0.0.6'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magicbus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: