Class: Synapse::BaseWatcher
- Inherits:
-
Object
- Object
- Synapse::BaseWatcher
- Defined in:
- lib/synapse/service_watcher/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#backends ⇒ Object
readonly
Returns the value of attribute backends.
-
#listen ⇒ Object
readonly
Returns the value of attribute listen.
-
#local_port ⇒ Object
readonly
Returns the value of attribute local_port.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#server_options ⇒ Object
readonly
Returns the value of attribute server_options.
Instance Method Summary collapse
-
#initialize(opts = {}, synapse) ⇒ BaseWatcher
constructor
A new instance of BaseWatcher.
- #start ⇒ Object
Constructor Details
#initialize(opts = {}, synapse) ⇒ BaseWatcher
Returns a new instance of BaseWatcher.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/synapse/service_watcher/base.rb', line 6 def initialize(opts={}, synapse) super() @synapse = synapse # set required service parameters %w{name discovery local_port}.each do |req| raise ArgumentError, "missing required option #{req}" unless opts[req] end @name = opts['name'] @discovery = opts['discovery'] @local_port = opts['local_port'] # optional service parameters @listen = opts['listen'] || [] @server_options = opts['server_options'] || "" @default_servers = opts['default_servers'] || [] @server_port_override = opts['server_port_override'] # set initial backends to default servers @backends = @default_servers validate_discovery_opts end |
Instance Attribute Details
#backends ⇒ Object (readonly)
Returns the value of attribute backends.
4 5 6 |
# File 'lib/synapse/service_watcher/base.rb', line 4 def backends @backends end |
#listen ⇒ Object (readonly)
Returns the value of attribute listen.
4 5 6 |
# File 'lib/synapse/service_watcher/base.rb', line 4 def listen @listen end |
#local_port ⇒ Object (readonly)
Returns the value of attribute local_port.
4 5 6 |
# File 'lib/synapse/service_watcher/base.rb', line 4 def local_port @local_port end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/synapse/service_watcher/base.rb', line 4 def name @name end |
#server_options ⇒ Object (readonly)
Returns the value of attribute server_options.
4 5 6 |
# File 'lib/synapse/service_watcher/base.rb', line 4 def @server_options end |
Instance Method Details
#start ⇒ Object
32 33 34 |
# File 'lib/synapse/service_watcher/base.rb', line 32 def start log.info "synapse: starting stub watcher; this means doing nothing at all!" end |