### Table of Contents - [constructor](#constructor) - [bind](#bind) - [unbind](#unbind) - [delete](#delete) - [clearUnboundedPorts](#clearunboundedports) - [isBound](#isbound) - [queue](#queue) - [get](#get) - [create](#create) - [createChannel](#createchannel) - [getNextMessage](#getnextmessage) ## constructor [portManager.js:33-44](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L33-L44 "Source code on GitHub") The port manager manages the the ports. This inculdes creation, deletion fetching and waiting on ports **Parameters** - `opts` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - `opts.state` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - `opts.hypervisor` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - `opts.exoInterface` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## bind [portManager.js:51-73](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L51-L73 "Source code on GitHub") binds a port to a name **Parameters** - `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the port - `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port to bind ## unbind [portManager.js:80-92](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L80-L92 "Source code on GitHub") unbinds a port given its name **Parameters** - `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## delete [portManager.js:98-102](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L98-L102 "Source code on GitHub") delete an port given the name it is bound to **Parameters** - `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ## clearUnboundedPorts [portManager.js:112-120](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L112-L120 "Source code on GitHub") clears any unbounded ports referances ## isBound [portManager.js:127-129](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L127-L129 "Source code on GitHub") check if a port object is still valid **Parameters** - `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** ## queue [portManager.js:135-157](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L135-L157 "Source code on GitHub") queues a message on a port **Parameters** - `name` - `message` **Message** ## get [portManager.js:164-166](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L164-L166 "Source code on GitHub") gets a port given it's name **Parameters** - `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## create [portManager.js:174-193](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L174-L193 "Source code on GitHub") creates a new container. Returning a port to it. **Parameters** - `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - `data` **any** the data to populate the initail state with Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## createChannel [portManager.js:199-213](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L199-L213 "Source code on GitHub") creates a channel returns the created ports in an Array Returns **[array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** ## getNextMessage [portManager.js:229-257](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L229-L257 "Source code on GitHub") Waits for the the next message if any Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)**