Constructor
new FlitterApp(units)
Instantiate the application.
Name | Type | Description |
---|---|---|
units |
object | mapping of names to static Unit CLASS definitions |
- Source:
Extends
Members
(static) name
Get the name of this app's service: 'app'
- Source:
(private) __unit_array :Array.<string>
Array of unit names.
- Array.<string>
- Source:
__units :Array.<module:libflitter/Unit~Unit>
The app's units.
- Array.<module:libflitter/Unit~Unit>
- Source:
(private) _di_allow_defer :boolean
If true, the injector will defer the class if the class requests any services that the container is missing. These services are filled in later and added to the prototype and any instances. True by default.
- boolean
- Source:
(private) _di_deferred_instances :Array.<module:flitter-di/src/Injectable~Injectable>
Collection of instances of this class that need to have the deferred service instances injected into them when the deferred services are finally provided.
- Source:
(private) _di_deferred_services :Array.<string>
List of services that were deferred and not provided at the time of injection.
- Array.<string>
- Source:
analyzer :module:libflitter/app/Analyzer~Analyzer
Analyzer used to process various aspects of the application.
- Source:
directories :object
Mapping of directory names to paths.
- object
- Source:
enable_analyzer :boolean
If true, the module:libflitter/app/Analyzer~Analyzer will check the application dependencies before run.
- boolean
- Source:
express :express
The underlying Express.js app.
- express
- Source:
output :module:libflitter/utility/services/Output~Output
Instance of the output service.
- Source:
Methods
(private) __init_dependency_injector()
Initialize the dependency injector for this app, adding the configured units to the container as services.
- Source:
(async, private) __init_unit(unit) → {Promise.<*>}
Start a single unit.
Name | Type | Description |
---|---|---|
unit |
module:libflitter/Unit~Unit |
- Source:
- Type
- Promise.<*>
(async, private) __stop_unit(unit) → {Promise.<void>}
Stop a single unit.
Name | Type | Description |
---|---|---|
unit |
module:libflitter/Unit~Unit |
- Source:
- Type
- Promise.<void>
(async) app_error(e) → {Promise.<void>}
Handle an application-level error. This will cause Flitter to terminate. If the error passed is an instance of {module:libflitter/error/FatalError~FatalError}, it will terminate immediately. Otherwise, it will try to shut down cleanly.
Name | Type | Description |
---|---|---|
e |
Error |
- Source:
- Type
- Promise.<void>
di() → {module:flitter-di/src/DependencyInjector~DependencyInjector}
Get the DI.
- Source:
(async) down() → {Promise.<void>}
Stop the application cleanly by stopping all units.
- Source:
- Type
- Promise.<void>
make(Class) → {*}
Inject dependencies into the static class.
Name | Type | Description |
---|---|---|
Class |
module:flitter-di/src/Injectable~Injectable | the static CLASS |
- Deprecated:
- Yes
- Source:
- the injected CLASS
- Type
- *
(async) run() → {Promise.<void>}
Run the application by starting, then cleanly stopping all units.
- Source:
- Type
- Promise.<void>
(async) up() → {Promise.<void>}
Initialize the application by starting all units.
- Source:
- Type
- Promise.<void>