Class: Nonnative::Service

Inherits:
Runner
  • Object
show all
Defined in:
lib/nonnative/service.rb

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

Attributes inherited from Runner

#proxy

Instance Method Summary collapse

Methods inherited from Runner

#initialize, #name

Constructor Details

This class inherits a constructor from Nonnative::Runner

Instance Method Details

#startvoid

This method returns an undefined value.

Starts the configured proxy (if any).



18
19
20
21
22
# File 'lib/nonnative/service.rb', line 18

def start
  proxy.start

  Nonnative.logger.info "started service '#{service.name}'"
end

#stopvoid

This method returns an undefined value.

Stops the configured proxy (if any).



27
28
29
30
31
# File 'lib/nonnative/service.rb', line 27

def stop
  proxy.stop

  Nonnative.logger.info "stopped service '#{service.name}'"
end