Class: Nonnative::ConfigurationService
- Inherits:
-
ConfigurationRunner
- Object
- ConfigurationRunner
- Nonnative::ConfigurationService
- Defined in:
- lib/nonnative/configuration_service.rb
Overview
Service-specific configuration.
A “service” is proxy-only: it does not start a Ruby thread or OS process. It exists so Nonnative can start and control a proxy in front of an external dependency.
Instances are usually created through Nonnative::Configuration#service.
Instance Attribute Summary collapse
-
#port ⇒ Integer
Client-facing port used by the service proxy.
-
#proxy ⇒ Nonnative::ConfigurationProxy
Proxy configuration for this service.
Attributes inherited from ConfigurationRunner
Instance Method Summary collapse
-
#initialize ⇒ void
constructor
Creates a service configuration with defaults.
-
#ports ⇒ void
Services expose a single proxy listener, so plural runner ports are not supported.
-
#ports=(_value) ⇒ void
Services expose a single proxy listener, so plural runner ports are not supported.
Constructor Details
#initialize ⇒ void
Creates a service configuration with defaults.
25 26 27 28 29 30 |
# File 'lib/nonnative/configuration_service.rb', line 25 def initialize super self.port = 0 @proxy = Nonnative::ConfigurationProxy.new end |
Instance Attribute Details
#port ⇒ Integer
Returns client-facing port used by the service proxy.
15 16 17 |
# File 'lib/nonnative/configuration_service.rb', line 15 def port @port end |
#proxy ⇒ Nonnative::ConfigurationProxy
Proxy configuration for this service.
20 21 22 |
# File 'lib/nonnative/configuration_service.rb', line 20 def proxy @proxy end |
Instance Method Details
#ports ⇒ void
This method returns an undefined value.
Services expose a single proxy listener, so plural runner ports are not supported.
58 59 60 |
# File 'lib/nonnative/configuration_service.rb', line 58 def ports raise ArgumentError, "Use 'port' instead of 'ports' for service '#{name}'" end |
#ports=(_value) ⇒ void
This method returns an undefined value.
Services expose a single proxy listener, so plural runner ports are not supported.
67 68 69 |
# File 'lib/nonnative/configuration_service.rb', line 67 def ports=(_value) raise ArgumentError, "Use 'port' instead of 'ports' for service '#{name}'" end |