@evosphere/legato
Advanced tools
Comparing version 0.0.11 to 0.0.12
{ | ||
"name": "@evosphere/legato", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Service management system", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -19,2 +19,17 @@ // @flow | ||
function createTimer() { | ||
return { | ||
startTime: 0, | ||
endTime: 0, | ||
start() { | ||
this.startTime = Date.now(); | ||
}, | ||
stop() { | ||
this.endTime = Date.now(); | ||
}, | ||
getTime() { | ||
return this.endTime - this.startTime; | ||
}, | ||
} | ||
} | ||
const Application : LegatoType = { | ||
@@ -41,11 +56,16 @@ /** | ||
* Create the application kernel | ||
* @param params | ||
* @param config | ||
* @returns {*} | ||
*/ | ||
create(params : Object) : ApplicationType { | ||
create(config : Object) : ApplicationType { | ||
if (typeof config !== "object" || config === null) { | ||
config = {}; | ||
} | ||
let definitions : ?ServiceDefinitionMap = {}; | ||
let services : ServiceMap = {}; | ||
let parameters : Object = typeof params === "object" && params !== null ? Object.assign({}, params.parameters) : {}; | ||
let parameters : Object = typeof config === "object" && config !== null ? Object.assign({}, config.parameters) : {}; | ||
let initialized : boolean = false; | ||
let bundles = []; | ||
let enableLogging = !!config.logging; | ||
@@ -76,2 +96,7 @@ /** | ||
return { | ||
timers: { | ||
loadingTimer: createTimer() | ||
}, | ||
loops: 0, | ||
/** | ||
@@ -126,4 +151,6 @@ * Return the parameters | ||
let keepGoing = true; | ||
this.timers.loadingTimer.start(); | ||
safeLoop(() => keepGoing, 100, function resolveDependencies() { | ||
this.loops++; | ||
safeLoop(() => keepGoing, 100, function resolveDependencies() { | ||
let serviceInitializedThisTurn = 0; | ||
@@ -160,4 +187,5 @@ for (let ref in definitions) { | ||
} | ||
}); | ||
}.bind(this)); | ||
this.timers.loadingTimer.stop(); | ||
definitions = null; | ||
@@ -164,0 +192,0 @@ initialized = true; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108518
355