Class: Nonnative::ConfigurationProcess

Inherits:
ConfigurationRunner show all
Defined in:
lib/nonnative/configuration_process.rb

Overview

Process-specific configuration.

A “process” is an OS-level child process started via ‘spawn` and stopped via signals. It is managed by Process at runtime.

Instances are usually created through Nonnative::Configuration#process.

Instance Attribute Summary collapse

Attributes inherited from ConfigurationRunner

#host, #name, #port, #proxy, #wait

Method Summary

Methods inherited from ConfigurationRunner

#initialize

Constructor Details

This class inherits a constructor from Nonnative::ConfigurationRunner

Instance Attribute Details

#commandProc

Returns a callable that returns the command to execute as a shell string or argv array (e.g. ‘-> { “./bin/api” }` or `-> { [“./bin/api”, “–port”, “8080”] }`).

Returns:

  • (Proc)

    a callable that returns the command to execute as a shell string or argv array (e.g. ‘-> { “./bin/api” }` or `-> { [“./bin/api”, “–port”, “8080”] }`)



17
18
19
# File 'lib/nonnative/configuration_process.rb', line 17

def command
  @command
end

#environmentHash?

Returns environment variables to pass to the spawned process.

Returns:

  • (Hash, nil)

    environment variables to pass to the spawned process



29
30
31
# File 'lib/nonnative/configuration_process.rb', line 29

def environment
  @environment
end

#logString

Returns log file path to append process stdout/stderr to.

Returns:

  • (String)

    log file path to append process stdout/stderr to



26
27
28
# File 'lib/nonnative/configuration_process.rb', line 26

def log
  @log
end

#signalString?

Returns signal name to use for stopping (defaults to ‘“INT”` when not set).

Returns:

  • (String, nil)

    signal name to use for stopping (defaults to ‘“INT”` when not set)



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

def signal
  @signal
end

#timeoutNumeric

Returns readiness timeout (seconds) used when waiting for the port to open/close.

Returns:

  • (Numeric)

    readiness timeout (seconds) used when waiting for the port to open/close



23
24
25
# File 'lib/nonnative/configuration_process.rb', line 23

def timeout
  @timeout
end