git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 016c6df49758e5db4d0f3caaf955ad714e137afc

nitpick

wanderer committed on 7/6/2017, 12:52:56 AM
Parent: 979a3baec32a154440a1d6bb659f2130326a0c4f

Files changed

index.jschanged
kernel.jschanged
portManager.jschanged
index.jsView
@@ -108,12 +108,11 @@
108108 // save the container in the state
109109 await this.graph.set(this.state, idHash, state)
110110 // create the container instance
111111 const instance = await this._loadInstance(idHash)
112-
113112 resolve(instance)
114113 // send the intialization message
115- instance.initialize(message)
114+ await instance.initialize(message)
116115
117116 return instance
118117 }
119118
kernel.jsView
@@ -51,12 +51,9 @@
5151 // check if the ports are saturated, if so we don't have to wait on the
5252 // scheduler
5353 const message = await this.ports.getNextMessage()
5454
55- if (!message) {
56- // if no more messages then shut down
57- this.hypervisor.scheduler.done(this.id)
58- } else {
55+ if (message) {
5956 message.fromPort.messages.shift()
6057 // if the message we recived had more ticks then we currently have the
6158 // update it
6259 if (message._fromTicks > this.ticks) {
@@ -64,8 +61,11 @@
6461 this.hypervisor.scheduler.update(this)
6562 }
6663 // run the next message
6764 return this.run(message)
65+ } else {
66+ // if no more messages then shut down
67+ this.hypervisor.scheduler.done(this.id)
6868 }
6969 }
7070
7171 /**
portManager.jsView
@@ -112,9 +112,9 @@
112112 this._unboundPorts.forEach(port => {
113113 this.kernel.send(port, new DeleteMessage())
114114 })
115115 this._unboundPorts.clear()
116- if (Object.keys(this.ports).length === 0) {
116+ if (!Object.keys(this.ports).length) {
117117 this.hypervisor.addNodeToCheck(this.id)
118118 }
119119 }
120120

Built with git-ssb-web