dryad-cluster 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -6
- data/lib/dryad/cluster.rb +13 -2
- data/lib/dryad/cluster/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1307a6537d19b819449916c7c2750ed95e33548cf6885a86961e2d7e91c2ad2
|
4
|
+
data.tar.gz: d7040e156d4d136c18731e9e2e40ad11ad9585bf1963bd8cb041a1ab5ef272dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52e72dec04aa5648343e3c8c00275d136a8736b1087731072cad558420d6676c6d92b9e839265eeb41efce18a6d758267c36a163db6b168dc8368ecb756dba58
|
7
|
+
data.tar.gz: b667cb5c55f432dcfdf7417c120a0f099474f713b5c275db0e75904de27b90d6fe108c37948e8677b8364ad4d6d55b7c10c1feb6403c81236ffad0ecc7eafe13
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dryad-cluster (1.
|
4
|
+
dryad-cluster (1.1.0)
|
5
5
|
concurrent-ruby (~> 1.1, >= 1.1.5)
|
6
|
-
dryad-consul (= 1.
|
7
|
-
dryad-core (= 1.
|
6
|
+
dryad-consul (= 1.1.0)
|
7
|
+
dryad-core (= 1.1.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -15,11 +15,11 @@ GEM
|
|
15
15
|
diplomat (2.2.5)
|
16
16
|
deep_merge (~> 1.0, >= 1.0.1)
|
17
17
|
faraday (~> 0.9)
|
18
|
-
dryad-consul (1.
|
18
|
+
dryad-consul (1.1.0)
|
19
19
|
concurrent-ruby (~> 1.1, >= 1.1.5)
|
20
20
|
diplomat (~> 2.2, >= 2.2.4)
|
21
|
-
dryad-core (= 1.
|
22
|
-
dryad-core (1.
|
21
|
+
dryad-core (= 1.1.0)
|
22
|
+
dryad-core (1.1.0)
|
23
23
|
faraday (0.15.4)
|
24
24
|
multipart-post (>= 1.2, < 3)
|
25
25
|
multipart-post (2.1.1)
|
data/lib/dryad/cluster.rb
CHANGED
@@ -32,8 +32,19 @@ module Dryad
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def sorted_instances(service_name, schema, groups, observer)
|
35
|
-
|
36
|
-
|
35
|
+
sis = if @configuration.cluster.nil?
|
36
|
+
registry = Object.const_get(@configuration.registry).instance
|
37
|
+
registry.service_instances(service_name, schema, groups, observer)
|
38
|
+
else
|
39
|
+
(@configuration.cluster[service_name.to_sym] || []).map do |s|
|
40
|
+
Dryad::Core::ServiceInstance.new(
|
41
|
+
name: service_name,
|
42
|
+
schema: schema,
|
43
|
+
address: s[:address],
|
44
|
+
port: s[:port]
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
37
48
|
sis.sort {|a, b| "#{a.address}:#{a.port}" <=> "#{b.address}:#{b.port}"}
|
38
49
|
end
|
39
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dryad-cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pan Jie
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dryad-core
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0
|
19
|
+
version: 1.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0
|
26
|
+
version: 1.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dryad-consul
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0
|
33
|
+
version: 1.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0
|
40
|
+
version: 1.1.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: concurrent-ruby
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|