magicbus 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ class MagicBus::Publisher
2
2
 
3
3
  class << self
4
4
  attr_accessor :conection
5
+ attr_accessor :channels
5
6
  end
6
7
 
7
8
  def self.scatter(group, action, model, &block)
@@ -34,13 +35,10 @@ class MagicBus::Publisher
34
35
  def self.publish(user_id, data)
35
36
 
36
37
  user_id = user_id.to_s
37
-
38
- channel = MagicBus::Subscriber.channels[user_id]
39
-
40
- if channel
41
- exchange = channel.fanout('syme')
42
- exchange.publish(data.to_json)
43
- end
38
+ channels[user_id] ||= AMQP::Channel.new(connection)
39
+ channel = channels[user_id]
40
+ exchange = channel.fanout('syme')
41
+ exchange.publish(data.to_json)
44
42
 
45
43
  end
46
44
 
@@ -1,5 +1,5 @@
1
1
  module MagicBus
2
2
 
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
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.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: