Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderer committed Jul 3, 2017
1 parent 679caf4 commit 166a2a7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel.js
Expand Up @@ -42,7 +42,7 @@ module.exports = class Kernel {

initialize (message) {
this.containerState = 'running'
this.run(message, true)
this.run(message, 'initialize')
}

// waits for the next message
Expand Down Expand Up @@ -73,7 +73,7 @@ module.exports = class Kernel {
* @param {boolean} init - whether or not to run the intialization routine
* @returns {Promise}
*/
async run (message, init = false) {
async run (message, method = 'run') {
let result

message.ports.forEach(port => this.ports._unboundPorts.add(port))
Expand All @@ -82,7 +82,6 @@ module.exports = class Kernel {
if (message.constructor === DeleteMessage) {
this.ports._delete(message.fromName)
} else {
const method = init ? 'initialize' : 'run'
try {
result = await this.container[method](message) || {}
} catch (e) {
Expand Down

0 comments on commit 166a2a7

Please sign in to comment.