metacosm 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66827fd4b46abafb5968f2e5edfbc81fb0d0bf6a
4
- data.tar.gz: be2c788d20092c47e8ce694f301a35c02c7fbf3b
3
+ metadata.gz: b791dadd34aa1c25af456378262af8bff854c1cd
4
+ data.tar.gz: ad2e8bfc5761418c9d08d8a945d967387a45a2b6
5
5
  SHA512:
6
- metadata.gz: 0f4b1ed809a9ae97e6912ac49e53c27994b5931d7931037ce5c99ceff02587bf0d3acef582005664bf421c6ae97919ea5f36255fe4d474650c54df1c28e3bbdf
7
- data.tar.gz: 744ddc7537917dd4b691076c33cc8bc07b2ad142c309148e903c3635eee8125cbe555d461fcb889a7239e60c42f7595944261ec1f8b61d43489e1044c67097b4
6
+ metadata.gz: 294be92110a7e5ffad26a34d75d52ac1d15efffc2a053aeba53f6c61a4fb1fb2d05850217d9ee11d0dcb5d930b172ce9292ffffb80fdf123cc3699c2e70e32f3
7
+ data.tar.gz: 39120b57afc4b8aed3b41fdefec15a0ae25123c03a7c5eb0040da216c5ab4cb392f8c54c46a7320782aeb648b73a1c8c0df57a7a8758c01d8061e9e4ad8091c8
@@ -6,10 +6,6 @@ module Metacosm
6
6
  setup_connection
7
7
  end
8
8
 
9
- def redis_connection
10
- Redis.new
11
- end
12
-
13
9
  def apply(command); fire command end
14
10
 
15
11
  def fire(command)
@@ -1,5 +1,10 @@
1
1
  module Metacosm
2
2
  class Simulation
3
+ # TODO protected?
4
+ def redis_connection
5
+ Redis.new
6
+ end
7
+
3
8
  def fire(command)
4
9
  command_queue.push(command)
5
10
  end
@@ -57,7 +62,7 @@ module Metacosm
57
62
 
58
63
  if !@event_publication_channel.nil?
59
64
  event_dto = event.attrs.merge(listener_module: event.listener_module_name, listener_class_name: event.listener_class_name)
60
- redis = Redis.new
65
+ redis = redis_connection
61
66
  redis.publish(@event_publication_channel, Marshal.dump(event_dto))
62
67
  end
63
68
 
@@ -84,7 +89,7 @@ module Metacosm
84
89
  def subscribe_for_commands(channel:)
85
90
  p [ :subscribe_to_command_channel, channel: channel ]
86
91
  @command_subscription_thread = Thread.new do
87
- redis = Redis.new
92
+ redis = redis_connection
88
93
  begin
89
94
  redis.subscribe(channel) do |on|
90
95
  on.subscribe do |chan, subscriptions|
@@ -1,4 +1,4 @@
1
1
  module Metacosm
2
2
  # metacosm version
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metacosm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Weissman