Commit eec495cebe6cfffd8d1cb71c3d83f4ce2c9d30a7
rename methods
wanderer committed on 5/16/2017, 3:43:24 PMParent: a378a2df93c85f8e6fe2dbfe58627b085c7bc7d3
Files changed
portManager.js | changed |
portManager.js | ||
---|---|---|
@@ -38,23 +38,29 @@ | ||
38 | 38 | |
39 | 39 | async start () { |
40 | 40 | // skip the root, since it doesn't have a parent |
41 | 41 | if (this.parentPort !== undefined) { |
42 | - this._mapPort(ENTRY, this.parentPort) | |
42 | + this._bindRef(this.parentPort, ENTRY) | |
43 | 43 | } |
44 | 44 | // map ports to thier id's |
45 | 45 | this.ports = await this.hypervisor.graph.get(this.state, 'ports') |
46 | 46 | Object.keys(this.ports).map(name => { |
47 | 47 | const port = this.ports[name] |
48 | - this._mapPort(name, port) | |
48 | + this._bindRef(port, name) | |
49 | 49 | }) |
50 | 50 | } |
51 | 51 | |
52 | - _mapPort (name, portRef) { | |
52 | + _bindRef (portRef, name) { | |
53 | 53 | const port = new Port(name) |
54 | 54 | this._portMap.set(portRef, port) |
55 | 55 | } |
56 | 56 | |
57 | + bind (port, name) { | |
58 | + // save the port instance | |
59 | + this.ports[name] = port | |
60 | + this._bindRef(port, name) | |
61 | + } | |
62 | + | |
57 | 63 | queue (message) { |
58 | 64 | this._portMap.get(message.fromPort).queue(message) |
59 | 65 | } |
60 | 66 | |
@@ -71,14 +77,8 @@ | ||
71 | 77 | isValidPort (port) { |
72 | 78 | return this._portMap.has(port) |
73 | 79 | } |
74 | 80 | |
75 | - bind (port, name) { | |
76 | - // save the port instance | |
77 | - this.ports[name] = port | |
78 | - this._mapPort(name, port) | |
79 | - } | |
80 | - | |
81 | 81 | create (type) { |
82 | 82 | const VM = this.hypervisor._VMs[type] |
83 | 83 | const parentId = this.entryPort ? this.entryPort.id : null |
84 | 84 | let nonce = this.state['/'].nonce |
Built with git-ssb-web