cocaine-framework 0.12.0.pre.rc5 → 0.12.0.pre.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocaine/cocaine.rb +24 -7
- data/lib/cocaine/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: fe7ba3ce0e4694bf2b6d8de27c65d9ab78228095
|
4
|
+
data.tar.gz: ce289e5e28ede7542c1198c0e4c908af06fb4469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa3dd76a15e0c83977d7e71dfd4feca569dd8e582b62a8bc2416cf5de92637782a00e2dcf59cf57b1a5e7878fcbd54924b193bd1c7656dcc86a153e123153eb5
|
7
|
+
data.tar.gz: 5d39c36e3f75a03a5d313887d42fd5b0da6ea56e76fc958d64d33069076dd1cc9e595f3636be4ac7c9c5cf5f9a6adc332a3c6f3a0f24cf722c29eecf1d4c7b03
|
data/lib/cocaine/cocaine.rb
CHANGED
@@ -7,7 +7,8 @@ require 'celluloid'
|
|
7
7
|
require 'celluloid/io'
|
8
8
|
|
9
9
|
module Cocaine
|
10
|
-
#
|
10
|
+
# [Detail]
|
11
|
+
# For dynamic method creation.
|
11
12
|
class Meta
|
12
13
|
def metaclass
|
13
14
|
class << self
|
@@ -22,8 +23,24 @@ module Cocaine
|
|
22
23
|
|
23
24
|
module Default
|
24
25
|
module Locator
|
25
|
-
|
26
|
-
|
26
|
+
def host
|
27
|
+
@host || '::'
|
28
|
+
end
|
29
|
+
|
30
|
+
def host=(host)
|
31
|
+
@host = host
|
32
|
+
end
|
33
|
+
|
34
|
+
def port
|
35
|
+
@port || 10053
|
36
|
+
end
|
37
|
+
|
38
|
+
def port=(port)
|
39
|
+
@port = port
|
40
|
+
end
|
41
|
+
|
42
|
+
module_function :host, :host=, :port, :port=
|
43
|
+
|
27
44
|
API = {
|
28
45
|
0 => [
|
29
46
|
'resolve',
|
@@ -221,7 +238,7 @@ module Cocaine
|
|
221
238
|
# [API]
|
222
239
|
class Locator < DefinedService
|
223
240
|
def initialize(host=nil, port=nil)
|
224
|
-
super :locator, [[host || Default::Locator
|
241
|
+
super :locator, [[host || Default::Locator.host, port || Default::Locator.port]], Default::Locator::API
|
225
242
|
end
|
226
243
|
end
|
227
244
|
|
@@ -395,10 +412,10 @@ module Cocaine
|
|
395
412
|
end.parse!
|
396
413
|
|
397
414
|
Cocaine::LOG.debug "Options: #{options}"
|
398
|
-
Default::Locator
|
399
|
-
Default::Locator
|
415
|
+
Default::Locator.host, sep, Default::Locator.port = options[:locator].rpartition(':')
|
416
|
+
Default::Locator.port = Default::Locator::port.to_i
|
400
417
|
|
401
|
-
Cocaine::LOG.debug "Setting default Locator endpoint to
|
418
|
+
Cocaine::LOG.debug "Setting default Locator endpoint to '#{Default::Locator.host}:#{Default::Locator.port}'"
|
402
419
|
return Worker.new(options[:app], options[:uuid], options[:endpoint])
|
403
420
|
end
|
404
421
|
end
|
data/lib/cocaine/version.rb
CHANGED