metacosm 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/metacosm/remote_simulation.rb +0 -4
- data/lib/metacosm/simulation.rb +7 -2
- data/lib/metacosm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b791dadd34aa1c25af456378262af8bff854c1cd
|
4
|
+
data.tar.gz: ad2e8bfc5761418c9d08d8a945d967387a45a2b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 294be92110a7e5ffad26a34d75d52ac1d15efffc2a053aeba53f6c61a4fb1fb2d05850217d9ee11d0dcb5d930b172ce9292ffffb80fdf123cc3699c2e70e32f3
|
7
|
+
data.tar.gz: 39120b57afc4b8aed3b41fdefec15a0ae25123c03a7c5eb0040da216c5ab4cb392f8c54c46a7320782aeb648b73a1c8c0df57a7a8758c01d8061e9e4ad8091c8
|
data/lib/metacosm/simulation.rb
CHANGED
@@ -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 =
|
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 =
|
92
|
+
redis = redis_connection
|
88
93
|
begin
|
89
94
|
redis.subscribe(channel) do |on|
|
90
95
|
on.subscribe do |chan, subscriptions|
|
data/lib/metacosm/version.rb
CHANGED