- RunningProcess
Holds the information of a running process
- DaemonizerServer
- Daemonizer
- RunningProcessOptions :
Object
Spawn arguments
- SpawnArgs :
Object
Spawn arguments
- ENV :
Object
Environmental variables
- DaemonizerConfig :
Object
Holds the information of a running process
Kind: global class
Param | Type | Description |
---|---|---|
id | String |
The command to run. |
spawnArgs | SpawnArgs |
Spawn arguments |
options | RunningProcessOptions |
Configuration options |
Runs the program
Kind: instance method of RunningProcess
Re-starts the program
Kind: instance method of RunningProcess
Re-starts the program
Kind: instance method of RunningProcess
Kind: global class
Classdec: DaemonizerDaemon is the process manager that creates and control multiple spawned processes to monitor.
- DaemonizerServer
- instance
- static
- .isRunning([config]) ⇒
Number
|void
- .start(config, env) ⇒
Number
- .isRunning([config]) ⇒
daemonizerServer.findProcessById(id) ⇒ RunningProcess
| void
Returns a RunningProcess given an id
.
Kind: instance method of DaemonizerServer
Returns: RunningProcess
| void
- The running process
Param | Type | Description |
---|---|---|
id | String |
SubProcess id (different than pid) |
daemonizerServer.findProcessByPid(pid) ⇒ RunningProcess
| void
Returns a RunningProcess given an id
.
Kind: instance method of DaemonizerServer
Returns: RunningProcess
| void
- The running process
Param | Type | Description |
---|---|---|
pid | String |
Process id |
Forks a process & starts monitoring it
Kind: instance method of DaemonizerServer
Param | Type | Description |
---|---|---|
id | String |
Optional identifier for the process. If none if provided, the system will automatically try to guess one. |
spawnArgs | SpawnArgs |
|
processOptions | RunningProcessOptions |
Kind: instance method of DaemonizerServer
Param | Type |
---|---|
id | String |
Kind: static method of DaemonizerServer
Returns: Number
| void
- Returns the process id (pid) when the process is running. void
otherwise.
Param | Type | Description |
---|---|---|
[config] | DaemonizerConfig |
Defaults to default config. |
Kind: static method of DaemonizerServer
Returns: Number
- The process id (pid).
Throws:
Error
Throws 'Another process is already running (pid = ${ runningPid })' when a process is already running.
Param | Type | Description |
---|---|---|
config | DaemonizerConfig |
Defaults to default config. |
env | Object |
Environment key-value pairs. |
Kind: global class
Classdec: Daemonizer is a process manager that creates an instance to control multiple spawned processes to monitor.
Daemonizes a terminal application by sending the request to the running DaemonizerDaemon.
Kind: instance method of Daemonizer
Param | Type | Description |
---|---|---|
id | String |
The command to run. |
spawnArgs | SpawnArgs |
List of string arguments. |
processOptions | RunningProcessOptions |
List of string arguments. |
Spawn arguments
Kind: global typedef
See: child_process.spawn
Properties
Name | Type | Default | Description |
---|---|---|---|
[options.autoRestart] | Boolean |
true |
Whether to automatically restart the application after failure. |
[options.waitBeforeRestart] | Number |
1000 |
Milliseconds to wait before triggering autoRestart . |
[options.maximumAutoRestart] | Number |
100 |
Maximum amount of time the process can be autorestarted. Negative for infinite. |
Spawn arguments
Kind: global typedef
See: child_process.spawn
Properties
Name | Type | Description |
---|---|---|
command | String |
The command to run. |
args | Array |
List of string arguments. |
options | Object |
child_process.spawn options. |
Environmental variables
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[DAEMONIZER_CONFIG] | String |
JSON stringified string with default DaemonizerConfig configuration options. |
[DAEMONIZER_DAEMON_START] | Boolean |
When true , triggers automatically start |
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
[runningThread] | String |
../.running |
Path to file for storing information about the running thread. |
port | Number |
Port where socket.io will listen for connections. | |
ip | String |
IP address where socket.io will bind. |
© 2019 Martin Rafael [email protected]