Class: Nonnative::ConfigurationProcess
- Inherits:
-
ConfigurationRunner
- Object
- ConfigurationRunner
- Nonnative::ConfigurationProcess
- 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.
Constant Summary
Constants inherited from ConfigurationRunner
Nonnative::ConfigurationRunner::DEFAULT_TIMEOUT
Instance Attribute Summary collapse
-
#command ⇒ 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”] }`).
-
#environment ⇒ Hash?
Environment variables to pass to the spawned process.
-
#log ⇒ String
Log file path to append process stdout/stderr to.
-
#readiness ⇒ Nonnative::ConfigurationReadiness?
Optional HTTP readiness check.
-
#signal ⇒ String?
Signal name to use for stopping (defaults to ‘“INT”` when not set).
-
#timeout ⇒ Numeric
Readiness timeout (seconds) used when waiting for ports to open/close (defaults to ‘1.0`).
Attributes inherited from ConfigurationRunner
Instance Method Summary collapse
-
#initialize ⇒ void
constructor
Creates a process configuration with bounded lifecycle defaults.
Methods inherited from ConfigurationRunner
Constructor Details
#initialize ⇒ void
Creates a process configuration with bounded lifecycle defaults.
Defaults:
-
‘timeout`: `1.0`
40 41 42 43 44 |
# File 'lib/nonnative/configuration_process.rb', line 40 def initialize super self.timeout = DEFAULT_TIMEOUT end |
Instance Attribute Details
#command ⇒ Proc
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”] }`).
17 18 19 |
# File 'lib/nonnative/configuration_process.rb', line 17 def command @command end |
#environment ⇒ Hash?
Returns environment variables to pass to the spawned process.
29 30 31 |
# File 'lib/nonnative/configuration_process.rb', line 29 def environment @environment end |
#log ⇒ String
Returns log file path to append process stdout/stderr to.
26 27 28 |
# File 'lib/nonnative/configuration_process.rb', line 26 def log @log end |
#readiness ⇒ Nonnative::ConfigurationReadiness?
Returns optional HTTP readiness check.
32 33 34 |
# File 'lib/nonnative/configuration_process.rb', line 32 def readiness @readiness end |
#signal ⇒ String?
Returns 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 |
#timeout ⇒ Numeric
Returns readiness timeout (seconds) used when waiting for ports to open/close (defaults to ‘1.0`).
23 24 25 |
# File 'lib/nonnative/configuration_process.rb', line 23 def timeout @timeout end |