Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderer committed Nov 21, 2017
1 parent 54682db commit dc32702
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 49 deletions.
28 changes: 14 additions & 14 deletions docs/actor.md
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
31 changes: 18 additions & 13 deletions docs/capsManager.md
Expand Up @@ -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)**
14 changes: 7 additions & 7 deletions docs/hypervisor.md
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -72,12 +72,12 @@ 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

**Parameters**

- `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`)
16 changes: 8 additions & 8 deletions docs/inbox.md
Expand Up @@ -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
Expand All @@ -22,17 +22,17 @@ 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

**Parameters**

- `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

Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions docs/scheduler.md
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit dc32702

Please sign in to comment.