diff --git a/docs/actor.md b/docs/actor.md index 96b6f11..5f717f0 100644 --- a/docs/actor.md +++ b/docs/actor.md @@ -8,29 +8,29 @@ - [create](#create) - [shutdown](#shutdown) - [startup](#startup) -- [message](#message) +- [runMessage](#runmessage) - [incrementTicks](#incrementticks) - [createActor](#createactor) - [send](#send) ## constructor -[actor.js:15-31](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L15-L31 "Source code on GitHub") +[actor.js:15-31](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L15-L31 "Source code on GitHub") -the Kernel manages the varous message passing functions and provides +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 Kernel + - `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:38-43](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L38-L43 "Source code on GitHub") +[actor.js:38-43](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L38-L43 "Source code on GitHub") Mints a new capabilitly with a given tag @@ -42,7 +42,7 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer ## queue -[actor.js:50-53](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L50-L53 "Source code on GitHub") +[actor.js:50-53](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L50-L53 "Source code on GitHub") adds a message to this containers message queue @@ -53,7 +53,7 @@ adds a message to this containers message queue ## create -[actor.js:60-63](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L60-L63 "Source code on GitHub") +[actor.js:60-66](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L60-L66 "Source code on GitHub") runs the creation routine for the actor @@ -65,19 +65,19 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe ## shutdown -[actor.js:92-94](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L92-L94 "Source code on GitHub") +[actor.js:95-97](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L95-L97 "Source code on GitHub") Runs the shutdown routine for the actor ## startup -[actor.js:99-101](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L99-L101 "Source code on GitHub") +[actor.js:102-104](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L102-L104 "Source code on GitHub") Runs the startup routine for the actor -## message +## runMessage -[actor.js:109-130](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L109-L130 "Source code on GitHub") +[actor.js:112-132](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L112-L132 "Source code on GitHub") run the Actor with a given message @@ -90,7 +90,7 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe ## incrementTicks -[actor.js:136-139](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L136-L139 "Source code on GitHub") +[actor.js:138-141](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L138-L141 "Source code on GitHub") updates the number of ticks that the container has run @@ -100,7 +100,7 @@ updates the number of ticks that the container has run ## createActor -[actor.js:146-149](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L146-L149 "Source code on GitHub") +[actor.js:148-151](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L148-L151 "Source code on GitHub") creates an actor @@ -111,7 +111,7 @@ creates an actor ## send -[actor.js:166-172](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/actor.js#L166-L172 "Source code on GitHub") +[actor.js:168-174](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/actor.js#L168-L174 "Source code on GitHub") sends a message to a given port diff --git a/docs/capsManager.md b/docs/capsManager.md index 89ba2d4..43c803f 100644 --- a/docs/capsManager.md +++ b/docs/capsManager.md @@ -9,44 +9,49 @@ ## constructor -[capsManager.js:7-10](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/capsManager.js#L7-L10 "Source code on GitHub") +[capsManager.js:10-12](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/capsManager.js#L10-L12 "Source code on GitHub") -The caps manager manages perstantly stores the capabilities +The port manager manages the the ports. This inculdes creation, deletion fetching and waiting on ports **Parameters** -- `caps` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** +- `caps` +- `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)** ## store -[capsManager.js:17-19](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/capsManager.js#L17-L19 "Source code on GitHub") +[capsManager.js:19-22](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/capsManager.js#L19-L22 "Source code on GitHub") -Stores a capability persistantly +binds a port to a name **Parameters** -- `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** -- `cap` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** +- `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the port +- `cap` +- `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port to bind ## get -[capsManager.js:26-29](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/capsManager.js#L26-L29 "Source code on GitHub") +[capsManager.js:29-32](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/capsManager.js#L29-L32 "Source code on GitHub") -gets a cap given it's key +gets a port given it's name **Parameters** -- `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** +- `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)** ## delete -[capsManager.js:35-37](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/capsManager.js#L35-L37 "Source code on GitHub") +[capsManager.js:38-40](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/capsManager.js#L38-L40 "Source code on GitHub") -delete an cap given its key +delete an port given the name it is bound to **Parameters** -- `key` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** +- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** diff --git a/docs/hypervisor.md b/docs/hypervisor.md index 2e3ce8a..306f1fe 100644 --- a/docs/hypervisor.md +++ b/docs/hypervisor.md @@ -11,7 +11,7 @@ ## constructor -[index.js:10-15](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/index.js#L10-L15 "Source code on GitHub") +[index.js:10-15](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/index.js#L10-L15 "Source code on GitHub") The Hypervisor manages the container instances by instantiating them and destorying them when possible. It also facilitates localating Containers @@ -22,7 +22,7 @@ destorying them when possible. It also facilitates localating Containers ## send -[index.js:23-27](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/index.js#L23-L27 "Source code on GitHub") +[index.js:23-27](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/index.js#L23-L27 "Source code on GitHub") sends a message @@ -35,7 +35,7 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe ## getActor -[index.js:52-63](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/index.js#L52-L63 "Source code on GitHub") +[index.js:52-63](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/index.js#L52-L63 "Source code on GitHub") gets an existsing actor @@ -47,7 +47,7 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe ## createActor -[index.js:71-95](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/index.js#L71-L95 "Source code on GitHub") +[index.js:71-95](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/index.js#L71-L95 "Source code on GitHub") creates an instance of an Actor @@ -59,7 +59,7 @@ creates an instance of an Actor ## createStateRoot -[index.js:108-111](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/index.js#L108-L111 "Source code on GitHub") +[index.js:108-111](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/index.js#L108-L111 "Source code on GitHub") creates a state root starting from a given container and a given number of ticks @@ -72,7 +72,7 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe ## registerContainer -[index.js:119-124](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/index.js#L119-L124 "Source code on GitHub") +[index.js:119-124](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/index.js#L119-L124 "Source code on GitHub") regirsters a container with the hypervisor @@ -80,4 +80,4 @@ regirsters a container with the hypervisor - `Constructor` **Class** a Class for instantiating the container - `args` **any** any args that the contructor takes -- `typeId` **Interger** the container's type identification ID (optional, default `Constructor.typeId`) +- `typeId` **Integer** the container's type identification ID (optional, default `Constructor.typeId`) diff --git a/docs/inbox.md b/docs/inbox.md index 197edab..138603a 100644 --- a/docs/inbox.md +++ b/docs/inbox.md @@ -4,12 +4,12 @@ - [constructor](#constructor) - [queue](#queue) -- [waitOnTag](#waitontag) -- [getNextMessage](#getnextmessage) +- [nextTaggedMessage](#nexttaggedmessage) +- [nextMessage](#nextmessage) ## constructor -[inbox.js:12-20](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/inbox.js#L12-L20 "Source code on GitHub") +[inbox.js:23-31](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/inbox.js#L23-L31 "Source code on GitHub") The inbox manages and sorts incoming messages and provides functions to wait on messages @@ -22,7 +22,7 @@ to wait on messages ## queue -[inbox.js:26-36](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/inbox.js#L26-L36 "Source code on GitHub") +[inbox.js:37-47](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/inbox.js#L37-L47 "Source code on GitHub") queues a message @@ -30,9 +30,9 @@ queues a message - `message` **Message** -## waitOnTag +## nextTaggedMessage -[inbox.js:44-59](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/inbox.js#L44-L59 "Source code on GitHub") +[inbox.js:55-66](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/inbox.js#L55-L66 "Source code on GitHub") Waits for a message sent with a capablitly that has one of the given tags @@ -43,9 +43,9 @@ Waits for a message sent with a capablitly that has one of the given tags Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** -## getNextMessage +## nextMessage -[inbox.js:66-95](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/inbox.js#L66-L95 "Source code on GitHub") +[inbox.js:73-109](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/inbox.js#L73-L109 "Source code on GitHub") Waits for the the next message if any diff --git a/docs/scheduler.md b/docs/scheduler.md index 2cb88ac..6a8dc9d 100644 --- a/docs/scheduler.md +++ b/docs/scheduler.md @@ -12,14 +12,14 @@ ## constructor -[scheduler.js:10-19](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L10-L19 "Source code on GitHub") +[scheduler.js:14-20](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/scheduler.js#L14-L20 "Source code on GitHub") The Scheduler manages the run cycle of Actors and figures out which order they should run in ## lock -[scheduler.js:26-28](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L26-L28 "Source code on GitHub") +[scheduler.js:27-29](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/scheduler.js#L27-L29 "Source code on GitHub") locks the scheduler from clearing waits untill the lock is resolved @@ -31,7 +31,7 @@ Returns **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Ref ## update -[scheduler.js:34-39](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L34-L39 "Source code on GitHub") +[scheduler.js:35-40](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/scheduler.js#L35-L40 "Source code on GitHub") updates an instance with a new tick count @@ -41,7 +41,7 @@ updates an instance with a new tick count ## getInstance -[scheduler.js:51-53](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L51-L53 "Source code on GitHub") +[scheduler.js:52-54](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/scheduler.js#L52-L54 "Source code on GitHub") returns an Actor instance @@ -53,7 +53,7 @@ Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer ## done -[scheduler.js:59-63](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L59-L63 "Source code on GitHub") +[scheduler.js:60-64](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/scheduler.js#L60-L64 "Source code on GitHub") deletes an instance from the scheduler @@ -63,7 +63,7 @@ deletes an instance from the scheduler ## wait -[scheduler.js:72-86](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L72-L86 "Source code on GitHub") +[scheduler.js:73-83](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/scheduler.js#L73-L83 "Source code on GitHub") returns a promise that resolves once all containers have reached the given number of ticks @@ -77,7 +77,7 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe ## leastNumberOfTicks -[scheduler.js:92-101](https://github.com/primea/js-primea-hypervisor/blob/1623d0570d9d2c2c1859ca73c05054596cccf553/scheduler.js#L92-L101 "Source code on GitHub") +[scheduler.js:89-98](https://github.com/primea/js-primea-hypervisor/blob/54682dbb20afd58e4292b4d018b5724bbdf68516/scheduler.js#L89-L98 "Source code on GitHub") returns the oldest container's ticks