Skip to content

Commit

Permalink
remove clists
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderer committed Nov 21, 2017
1 parent ad6bbae commit f6890c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
1 change: 0 additions & 1 deletion actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ module.exports = class Actor {
data: result
}))
}
this.caps.clist.clear()
}

/**
Expand Down
35 changes: 19 additions & 16 deletions capsManager.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
module.exports = class CapsManager {
/**
* The caps manager manages perstantly stores the capabilities
* The port manager manages the the ports. This inculdes creation, deletion
* fetching and waiting on ports
* @param {Object} caps
* @param {Object} opts
* @param {Object} opts.state
* @param {Object} opts.hypervisor
* @param {Object} opts.exoInterface
*/
constructor (caps) {
this._storedCaps = caps
this.clist = new Set()
}

/**
* Stores a capability persistantly
* @param {String} key
* @param {Object} cap
* binds a port to a name
* @param {Object} port - the port to bind
* @param {String} name - the name of the port
*/
store (key, cap) {
this._storedCaps[key] = cap
store (name, cap) {
// save the port instance
this._storedCaps[name] = cap
}

/**
* gets a cap given it's key
* @param {String} key
* gets a port given it's name
* @param {String} name
* @return {Object}
*/
get (key) {
const cap = this._storedCaps[key]
get (name) {
const cap = this._storedCaps[name]
return cap
}

/**
* delete an cap given its key
* @param {string} key
* delete an port given the name it is bound to
* @param {string} name
*/
delete (key) {
delete this._storedCaps[key]
delete (name) {
delete this._storedCaps[name]
}
}

0 comments on commit f6890c6

Please sign in to comment.