plezi 0.10.1 → 0.10.2

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: 0a5c7776c37ebc623189d2a99863f6571fbef572
4
- data.tar.gz: 82f7af02e2db159f56d3bd8ee4ce4a2cc4553aca
3
+ metadata.gz: 5f99a6c5363bfd4c55ae83bccdd950960f70e09b
4
+ data.tar.gz: 1efec6a2d073e2c10ecae857ffd762125dd5c5d5
5
5
  SHA512:
6
- metadata.gz: efa0d7353a2e2e4e07a9c52867397731afe670e9fb51a69ba2e7b3b6f07d2ea54985a1037f50b620b06f47768f53285afb7e10023566da60eaa114f8034b64a4
7
- data.tar.gz: 52fd0e21072250e92837cc85cc236c2054c664c3a86e9517c96b796baca9bb26fb7ff9a243172b28a2f477b1cc6c5b6ae51faa6f3c62311bc2f67c45852febb7
6
+ metadata.gz: ad3c84e4434609d30e7770f2fc2d4b6b698054439b52a9484ca8fd38cd8decb93fc8f5e8f3b51bcf79378ca752fb60369957994d966ee3b3abbd33cbe72f967c
7
+ data.tar.gz: 6c19c160e6791996b23bc09dcca988f44a462c6ede451f35be1b2946ef65f7b1be611bf1ec1abefa40bb113a5ce44934ac80bb5f915dde452f0f63cd6755fcdc
data/CHANGELOG.md CHANGED
@@ -2,9 +2,17 @@
2
2
 
3
3
  ***
4
4
 
5
+ Change log v.0.10.2
6
+
7
+ **Fix**: fixed an issue where the Redis connection couldn't broadcast due to limited acess to the controller's methods.
8
+
9
+ **Fix**: fixed an issue with the server's UUID being set before the GReactor's forking, thereby disabling Redis communications between processed over te same machine.
10
+
11
+ ***
12
+
5
13
  Change log v.0.10.1
6
14
 
7
- **fix**: fixed an issue where the new Controller's inner router might route to RESTful methods that weren't defined (:show, :save, etc').
15
+ **Fix**: fixed an issue where the new Controller's inner router might route to RESTful methods that weren't defined (:show, :save, etc').
8
16
 
9
17
  **fix**: fixed an issue with the new Controller's inner router might not reset it's cache when methods are added to the controller after the service has begun.
10
18
 
@@ -22,23 +22,26 @@ module Plezi
22
22
  on.message do |channel, msg|
23
23
  begin
24
24
  data = YAML.load(msg)
25
- next if data[:server] == Plezi::Settings::UUID
25
+ next if data[:server] == Plezi::Settings.uuid
26
26
  if data[:target]
27
27
  GRHttp::Base::WSHandler.unicast data[:target], data
28
28
  else
29
29
  GRHttp::Base::WSHandler.broadcast data
30
30
  end
31
31
  rescue => e
32
- Plezi.error e
32
+ Reactor.error e
33
33
  end
34
34
  end
35
35
  end
36
36
  rescue => e
37
- Plezi.error e
37
+ Reactor.error e
38
38
  retry
39
39
  end
40
40
  end
41
41
  @redis
42
+ rescue => e
43
+ Reactor.error e
44
+ false
42
45
  end
43
46
  end
44
47
 
@@ -52,7 +52,9 @@ module Plezi
52
52
  end
53
53
 
54
54
  # This Server's UUID
55
- UUID = SecureRandom.uuid
55
+ def uuid
56
+ @uuid ||= SecureRandom.uuid
57
+ end
56
58
  end
57
59
  end
58
60
 
@@ -323,6 +323,8 @@ module Plezi
323
323
  (@inheritance ||= [].to_set) << sub
324
324
  end
325
325
 
326
+ public
327
+
326
328
 
327
329
  # WebSockets
328
330
 
@@ -339,7 +341,7 @@ module Plezi
339
341
 
340
342
  def __inner_redis_broadcast data
341
343
  conn = Plezi.redis_connection
342
- data[:server] = Plezi::Settings::UUID
344
+ data[:server] = Plezi::Settings.uuid
343
345
  return conn.publish( Plezi::Settings.redis_channel_name, data.to_yaml ) if conn
344
346
  false
345
347
  end
data/lib/plezi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plezi
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
@@ -23,8 +23,11 @@ Bundler.require(:default, ENV['ENV'].to_s.to_sym)
23
23
  # require tilt/sass in a thread safe way (before multi-threading cycle begins)
24
24
  require 'tilt/sass' if defined?(::Slim) && defined?(::Sass)
25
25
 
26
- # set up Plezi logs - Heroku logs to STDOUT, this machine logs to log file
27
- Plezi.create_logger File.expand_path(File.join 'logs','server.log'), ENV["RACK_ENV"]=="development" unless ENV['DYNO']
26
+ # set up Plezi's logs - Heroku logs to STDOUT, this machine logs to log file
27
+ GReactor.create_logger File.expand_path(File.join 'logs','server.log'), ENV["RACK_ENV"]=="development" unless ENV['DYNO']
28
+
29
+ ## Allow forking? ONLY if your code is fully scalable across processes.
30
+ # GReactor.set_forking 4
28
31
 
29
32
  # load all config files
30
33
  Dir[File.join "{config}", "**" , "*.rb"].each {|file| load File.expand_path(file)}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plezi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev