ruby_skynet 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -2
- data/examples/echo_server.rb +0 -2
- data/lib/ruby_skynet/service_registry.rb +3 -6
- data/lib/ruby_skynet/version.rb +1 -1
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 139490e673ffe7aabfc0336ebb5ac94d6841129c
|
4
|
+
data.tar.gz: d1028a7c66aaab258495e9353839303f95562e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 511bd404dba880d7943d2e6d39b9ed073298953c12ff8893dc84209e01a4c6405414a094f2f091969bb93e343e5e76da1a6a9913dc060e2fdcc5b6ce56710ca5
|
7
|
+
data.tar.gz: 2f0dc0d4dd1fc2ec015fe6dfe16ff655bac8db4bad3738de0c3bcca6dd38ee49b4eb44d1e2520c5575f33c506c34f28d57e0d15560816819b7eb084baa50a8c2
|
data/Rakefile
CHANGED
@@ -26,9 +26,10 @@ task :gem do |t|
|
|
26
26
|
spec.has_rdoc = true
|
27
27
|
spec.add_dependency 'semantic_logger', '>= 2.1.0'
|
28
28
|
spec.add_dependency 'resilient_socket', '>= 0.5.0'
|
29
|
-
spec.add_dependency 'multi_json', '>= 1.6.1'
|
30
29
|
spec.add_dependency 'bson', '>= 1.5.2'
|
31
|
-
spec.add_dependency '
|
30
|
+
spec.add_dependency 'gene_pool', '>= 1.3.0'
|
31
|
+
spec.add_dependency 'sync_attr', '>= 1.0.0'
|
32
|
+
spec.add_dependency 'ruby_doozer', '>= 0.7.0'
|
32
33
|
spec.add_dependency 'gene_pool', '>= 1.3.0'
|
33
34
|
end
|
34
35
|
Gem::Package.build gemspec
|
data/examples/echo_server.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'sync_attr'
|
2
|
-
require 'multi_json'
|
3
2
|
require 'thread_safe'
|
4
3
|
require 'gene_pool'
|
5
4
|
require 'resolv'
|
@@ -57,7 +56,7 @@ module RubySkynet
|
|
57
56
|
@current_revision = doozer.current_revision
|
58
57
|
# Fetch all the configuration information from Doozer and set the internal copy
|
59
58
|
doozer.walk(path, @current_revision) do |path, value|
|
60
|
-
service_info_changed(
|
59
|
+
service_info_changed(relative_key(path), value)
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
@@ -76,7 +75,7 @@ module RubySkynet
|
|
76
75
|
|
77
76
|
# Register the supplied service at this Skynet Server host and Port
|
78
77
|
def register_service(name, version, region, hostname, port)
|
79
|
-
|
78
|
+
self["#{name}/#{version}/#{region}/#{hostname}/#{port}"] = {
|
80
79
|
"Config" => {
|
81
80
|
"UUID" => "#{hostname}:#{port}-#{$$}-#{name}-#{version}",
|
82
81
|
"Name" => name,
|
@@ -90,7 +89,6 @@ module RubySkynet
|
|
90
89
|
},
|
91
90
|
"Registered" => true
|
92
91
|
}
|
93
|
-
self["#{name}/#{version}/#{region}/#{hostname}/#{port}"] = MultiJson.encode(config)
|
94
92
|
end
|
95
93
|
|
96
94
|
# Deregister the supplied service from the Registry
|
@@ -148,8 +146,7 @@ module RubySkynet
|
|
148
146
|
hostname, port = e[3], e[4]
|
149
147
|
|
150
148
|
if value
|
151
|
-
|
152
|
-
if entry['Registered']
|
149
|
+
if value['Registered']
|
153
150
|
add_server(key, hostname, port)
|
154
151
|
else
|
155
152
|
# Service just de-registered
|
data/lib/ruby_skynet/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_skynet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic_logger
|
@@ -39,47 +39,61 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bson
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.5.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.5.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: gene_pool
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.3.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.3.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: sync_attr
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.0.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: ruby_doozer
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - '>='
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
89
|
+
version: 0.7.0
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - '>='
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
96
|
+
version: 0.7.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: gene_pool
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|