git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit eec495cebe6cfffd8d1cb71c3d83f4ce2c9d30a7

rename methods

wanderer committed on 5/16/2017, 3:43:24 PM
Parent: a378a2df93c85f8e6fe2dbfe58627b085c7bc7d3

Files changed

portManager.jschanged
portManager.jsView
@@ -38,23 +38,29 @@
3838
3939 async start () {
4040 // skip the root, since it doesn't have a parent
4141 if (this.parentPort !== undefined) {
42- this._mapPort(ENTRY, this.parentPort)
42+ this._bindRef(this.parentPort, ENTRY)
4343 }
4444 // map ports to thier id's
4545 this.ports = await this.hypervisor.graph.get(this.state, 'ports')
4646 Object.keys(this.ports).map(name => {
4747 const port = this.ports[name]
48- this._mapPort(name, port)
48+ this._bindRef(port, name)
4949 })
5050 }
5151
52- _mapPort (name, portRef) {
52+ _bindRef (portRef, name) {
5353 const port = new Port(name)
5454 this._portMap.set(portRef, port)
5555 }
5656
57+ bind (port, name) {
58+ // save the port instance
59+ this.ports[name] = port
60+ this._bindRef(port, name)
61+ }
62+
5763 queue (message) {
5864 this._portMap.get(message.fromPort).queue(message)
5965 }
6066
@@ -71,14 +77,8 @@
7177 isValidPort (port) {
7278 return this._portMap.has(port)
7379 }
7480
75- bind (port, name) {
76- // save the port instance
77- this.ports[name] = port
78- this._mapPort(name, port)
79- }
80-
8181 create (type) {
8282 const VM = this.hypervisor._VMs[type]
8383 const parentId = this.entryPort ? this.entryPort.id : null
8484 let nonce = this.state['/'].nonce

Built with git-ssb-web