Class: Nonnative::ConfigurationRunner

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

Overview

Base configuration for a runnable unit managed by Nonnative.

This class holds connection and timing attributes common to processes, servers and services, as well as a nested ConfigurationProxy describing how/if a proxy should be started.

Instances of this type are typically created via Nonnative::Configuration#process, Nonnative::Configuration#server, or Nonnative::Configuration#service.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializevoid

Creates a runner configuration with defaults.

Defaults:



39
40
41
42
43
44
45
# File 'lib/nonnative/configuration_runner.rb', line 39

def initialize
  self.host = '0.0.0.0'
  self.port = 0
  self.wait = 0.1

  @proxy = Nonnative::ConfigurationProxy.new
end

Instance Attribute Details

#hostString, ...

Returns:

  • (String, nil)

    runner name used for lookup (for example via pool.process_by_name)

  • (String)

    host to bind/connect to (defaults to ‘“0.0.0.0”`)

  • (Integer)

    port to bind/connect to

  • (Numeric)

    wait interval (seconds) used by runners between lifecycle steps



20
21
22
# File 'lib/nonnative/configuration_runner.rb', line 20

def host
  @host
end

#nameString, ...

Returns:

  • (String, nil)

    runner name used for lookup (for example via pool.process_by_name)

  • (String)

    host to bind/connect to (defaults to ‘“0.0.0.0”`)

  • (Integer)

    port to bind/connect to

  • (Numeric)

    wait interval (seconds) used by runners between lifecycle steps



20
21
22
# File 'lib/nonnative/configuration_runner.rb', line 20

def name
  @name
end

#portString, ...

Returns:

  • (String, nil)

    runner name used for lookup (for example via pool.process_by_name)

  • (String)

    host to bind/connect to (defaults to ‘“0.0.0.0”`)

  • (Integer)

    port to bind/connect to

  • (Numeric)

    wait interval (seconds) used by runners between lifecycle steps



20
21
22
# File 'lib/nonnative/configuration_runner.rb', line 20

def port
  @port
end

#proxyNonnative::ConfigurationProxy

Proxy configuration for this runner.

Note that this returns a configuration object even if no proxy is enabled; by default the proxy kind is ‘“none”`.



28
29
30
# File 'lib/nonnative/configuration_runner.rb', line 28

def proxy
  @proxy
end

#waitString, ...

Returns:

  • (String, nil)

    runner name used for lookup (for example via pool.process_by_name)

  • (String)

    host to bind/connect to (defaults to ‘“0.0.0.0”`)

  • (Integer)

    port to bind/connect to

  • (Numeric)

    wait interval (seconds) used by runners between lifecycle steps



20
21
22
# File 'lib/nonnative/configuration_runner.rb', line 20

def wait
  @wait
end