cylons 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.rspec +1 -0
- data/Gemfile +3 -2
- data/Guardfile +39 -0
- data/README.md +93 -39
- data/bin/cylons +11 -12
- data/cylons.gemspec +13 -8
- data/lib/cylons.rb +43 -14
- data/lib/cylons/active_record_extensions.rb +20 -27
- data/lib/cylons/{remote_proxy.rb → agent.rb} +104 -47
- data/lib/cylons/config.rb +26 -0
- data/lib/cylons/connection.rb +11 -15
- data/lib/cylons/errors.rb +2 -1
- data/lib/cylons/local_registry.rb +5 -11
- data/lib/cylons/logging.rb +41 -0
- data/lib/cylons/railtie.rb +4 -25
- data/lib/cylons/registry_adapter.rb +10 -1
- data/lib/cylons/remote.rb +11 -22
- data/lib/cylons/remote_discovery.rb +29 -18
- data/lib/cylons/remote_pagination.rb +32 -0
- data/lib/cylons/remote_registry.rb +12 -15
- data/lib/cylons/remote_schema.rb +2 -2
- data/lib/cylons/rpc.rb +64 -72
- data/lib/cylons/service_manager.rb +30 -20
- data/lib/cylons/version.rb +1 -1
- data/spec/inventory_test_app.rb +24 -0
- data/spec/lib/cylons/connection_spec.rb +15 -0
- data/spec/lib/cylons/interface_spec.rb +7 -0
- data/spec/lib/cylons/remote_registry_spec.rb +57 -0
- data/spec/lib/cylons/service_manager_spec.rb +40 -4
- data/spec/spec_helper.rb +30 -2
- data/spec/support/inventory_test_node.rb +49 -0
- data/spec/support/schema.rb +24 -0
- metadata +181 -150
- data/lib/cylons/configuration.rb +0 -38
- data/spec/lib/cylons/remote_registry.rb +0 -7
data/lib/cylons/configuration.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'cylons'
|
2
|
-
require 'cylons/registry_adapter'
|
3
|
-
module Cylons
|
4
|
-
class Configuration
|
5
|
-
attr_accessor :address,
|
6
|
-
:logger,
|
7
|
-
:port,
|
8
|
-
:registry_address,
|
9
|
-
:registry_port,
|
10
|
-
:registry_adapter,
|
11
|
-
:registry,
|
12
|
-
:remote_namespace
|
13
|
-
|
14
|
-
#NOTE: I am explicitly setting address to machine address instead of local host due to zookeeper or possibly dcell issue.
|
15
|
-
# Basically I have been unable to connect the machine to registry via
|
16
|
-
#:addr => "tcp://localhost:9001" or whatever, have needed to connect using
|
17
|
-
#:addr => "tcp://192.168.0.101:9001", not sure if its an id10t error, or a local setting, or zookeeper or dcell
|
18
|
-
# lightbulb: maybe because its trying to connect to remote registry, and its telling the remote machine to use localhost?
|
19
|
-
# bet thats probably it.. Although I dont think I had same prob w redis. IDONTREMEMBER.
|
20
|
-
|
21
|
-
#TODO look into that further.
|
22
|
-
def initialize
|
23
|
-
self.address = ::Cylons::Interface.primary
|
24
|
-
self.port = (9000 + rand(100))
|
25
|
-
self.logger = ::Rails.logger if defined?(Rails)
|
26
|
-
self
|
27
|
-
end
|
28
|
-
|
29
|
-
#TODO: uhh refactor this, was having trouble w circular dependency and too tired to trace it down!
|
30
|
-
#This introduces order dependency when setting initializer=badmk
|
31
|
-
|
32
|
-
def registry_adapter=(adapter)
|
33
|
-
raise ::Cylons::InvalidRegistryAdapter unless ::Cylons::RegistryAdapter::VALID_REGISTRY_ADAPTERS.include?(adapter.to_sym)
|
34
|
-
@registry_adapter = adapter.to_sym
|
35
|
-
@registry = ::Cylons::RegistryAdapter.send(registry_adapter)
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|