Class: Nonnative::Service
Overview
Runtime runner for an external dependency.
A service runner does not manage an OS process or Ruby thread. It exists so Nonnative can manage a proxy lifecycle (start/stop/reset) for an external service that is managed elsewhere (for example a database running in Docker).
The underlying configuration is a ConfigurationService.
Instance Attribute Summary collapse
-
#proxy ⇒ Nonnative::Proxy
readonly
Returns the proxy instance for this service.
Instance Method Summary collapse
-
#initialize(service) ⇒ Service
constructor
A new instance of Service.
-
#start ⇒ void
Starts the configured proxy (if any).
-
#stop ⇒ void
Stops the configured proxy (if any).
Methods inherited from Runner
Constructor Details
#initialize(service) ⇒ Service
Returns a new instance of Service.
21 22 23 24 25 |
# File 'lib/nonnative/service.rb', line 21 def initialize(service) super @proxy = Nonnative::ProxyFactory.create(service) end |
Instance Attribute Details
#proxy ⇒ Nonnative::Proxy (readonly)
Returns the proxy instance for this service.
18 19 20 |
# File 'lib/nonnative/service.rb', line 18 def proxy @proxy end |