metacosm 0.3.5 → 0.3.6

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: 32a9468ddc61b93666240ed0e37c8830e46cb7b8
4
- data.tar.gz: 091a6a5dc7a9a73bf33497143acb0d55cbd78648
3
+ metadata.gz: 2c90b692bcdcdddcd754273a046127c9ec716e31
4
+ data.tar.gz: cfb3cca128d5af1441319c8a6f02227f1fd9ec88
5
5
  SHA512:
6
- metadata.gz: 2bc97229b74946aae45baabce178c1b10d5a934a6f1ba771b92cbc0b35bf5685242408e32e256f8b5f6787810381d80f606360203582965de8fe2e37f002a6ac
7
- data.tar.gz: eeec04ed90b61c33a2f73071d649f9666f51deceb4fcba47303d1ae68a470ee571059cd3bb63c6c86bfb35480f2bfae680a87e2fdade9f4117d1ca887fa23653
6
+ metadata.gz: 71241dcb632d859a39d055cb51300240214056536fd23ecf5cdc0ee0f7d56544e2185ee1d39cbc6a62a2750c8fc77658e758191de4efbbf6ff669edb960b9808
7
+ data.tar.gz: 113daa197a19a8a543c4ba41f0a50088cff3dcb50e80788256e2697817971c064f2488c295c3bbe6dfa583ba411fb3b24bcba4bd8ca4d920a0c204c1ed9f848c
@@ -1,6 +1,18 @@
1
1
  require 'connection_pool'
2
2
 
3
- REDIS = ConnectionPool.new(size: 3) do
3
+ REDIS_PUB = ConnectionPool.new(size: 2) do
4
+ if ENV['REDISTOGO_URL']
5
+ puts "---> using redis to go!"
6
+ uri = URI.parse(ENV["REDISTOGO_URL"])
7
+ puts "---> parsed uri: #{uri}"
8
+ Redis.new(:host => uri.host, :port => uri.port, :password => uri.password, :thread_safe => true)
9
+ else
10
+ puts "---> using default redis settings..."
11
+ Redis.new
12
+ end
13
+ end
14
+
15
+ REDIS_SUB = ConnectionPool.new(size: 2) do
4
16
  if ENV['REDISTOGO_URL']
5
17
  puts "---> using redis to go!"
6
18
  uri = URI.parse(ENV["REDISTOGO_URL"])
@@ -72,7 +72,7 @@ module Metacosm
72
72
 
73
73
  if !@event_publication_channel.nil?
74
74
  event_dto = event.attrs.merge(listener_module: event.listener_module_name, listener_class_name: event.listener_class_name)
75
- REDIS.with do |redis|
75
+ REDIS_PUB.with do |redis|
76
76
  redis.publish(@event_publication_channel, Marshal.dump(event_dto))
77
77
  end
78
78
  end
@@ -100,7 +100,7 @@ module Metacosm
100
100
  def subscribe_for_commands(channel:)
101
101
  p [ :subscribe_to_command_channel, channel: channel ]
102
102
  @command_subscription_thread = Thread.new do
103
- REDIS.with do |redis|
103
+ REDIS_SUB.with do |redis|
104
104
  begin
105
105
  redis.subscribe(channel) do |on|
106
106
  on.subscribe do |chan, subscriptions|
@@ -1,4 +1,4 @@
1
1
  module Metacosm
2
2
  # metacosm version
3
- VERSION = "0.3.5"
3
+ VERSION = "0.3.6"
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.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Weissman