### Table of Contents - [constructor](#constructor) - [mintCap](#mintcap) - [queue](#queue) - [create](#create) - [shutdown](#shutdown) - [startup](#startup) - [runMessage](#runmessage) - [incrementTicks](#incrementticks) - [createActor](#createactor) - [send](#send) ## constructor [actor.js:16-33](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L16-L33 "Source code on GitHub") the Actor manages the varous message passing functions and provides an interface for the containers to use **Parameters** - `opts` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - `opts.id` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the UUID of the Actor - `opts.state` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the state of the container - `opts.hypervisor` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the instance of the hypervisor - `opts.container` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the container constuctor and argments ## mintCap [actor.js:40-45](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L40-L45 "Source code on GitHub") Mints a new capabilitly with a given tag **Parameters** - `tag` **any** a tag which can be used to identify caps (optional, default `0`) Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## queue [actor.js:52-55](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L52-L55 "Source code on GitHub") adds a message to this actor's message queue **Parameters** - `message` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - `portName` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** ## create [actor.js:62-68](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L62-L68 "Source code on GitHub") runs the creation routine for the actor **Parameters** - `message` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## shutdown [actor.js:97-99](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L97-L99 "Source code on GitHub") Runs the shutdown routine for the actor ## startup [actor.js:104-106](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L104-L106 "Source code on GitHub") Runs the startup routine for the actor ## runMessage [actor.js:114-134](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L114-L134 "Source code on GitHub") run the Actor with a given message **Parameters** - `message` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the message to run - `method` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** which method to run (optional, default `'onMessage'`) Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## incrementTicks [actor.js:140-143](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L140-L143 "Source code on GitHub") updates the number of ticks that the actor has run **Parameters** - `count` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of ticks to add ## createActor [actor.js:150-153](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L150-L153 "Source code on GitHub") creates an actor **Parameters** - `type` **Integer** the type id for the container - `message` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** an intial [message](https://github.com/primea/js-primea-message) to send newly created actor ## send [actor.js:170-177](https://github.com/primea/js-primea-hypervisor/blob/46c11229b2dac84739660d8242a0eaa65697f8bc/actor.js#L170-L177 "Source code on GitHub") sends a message to a given port **Parameters** - `cap` - `message` **Message** the message - `portRef` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port