Class: Runnable

Runnable


new Runnable(name [, options])

Parameters:
Name Type Argument Description
name string

The name of the application.

options object <optional>

Application options

Properties:
Name Type Argument Default Description
options.logger object <optional>

Logger options

options.ignoreUncaught object <optional>
false

Whether to skip the handling of uncaught exception

options.exitOnUncaught object <optional>
true

Whether to exit process on uncaught exception thrown

Source:
Runnable.js

Methods


<static> getLib(libName)

Get the lib module

Parameters:
Name Type Description
libName string
Source:
Runnable.js

<static> getService(name)

Get a registered service

Parameters:
Name Type Description
name string
Source:
Runnable.js
Example
// Get service from a lib module
 const service = app.getService('<lib name>/<service name>');
 // e.g const service = app.getService('data/mysql.mydb');

<static> registerLib(lib)

Register a loaded lib module

Parameters:
Name Type Description
lib LibModule
Source:
Runnable.js

<static> requireFromLib(relativePath)

Require a module from the source path of a library module

Parameters:
Name Type Description
relativePath *
Source:
Runnable.js

<static> resetLogger()

Reset logger.
Use it only if the options.logger config is changed in runtime

Source:
Runnable.js

<async, static> start_()

Start the app

Source:
Runnable.js
Returns:
Type
Promise

<async, static> stop_()

Stop the app

Source:
Runnable.js
Returns:
Type
Promise