Commit b96d34ff7c58dbdbb3daa45e4639df438f669891
rebuild docs
wanderer committed on 6/28/2017, 11:27:34 PMParent: b507f49239a73767abbee979b4e637a6ca469764
Files changed
docs/hypervisor.md | changed |
docs/index.md | changed |
docs/portManager.md | changed |
docs/exoInterface.md | deleted |
docs/port.md | deleted |
package.json | changed |
docs/hypervisor.md | ||
---|---|---|
@@ -2,102 +2,111 @@ | ||
2 | 2 | |
3 | 3 | ### Table of Contents |
4 | 4 | |
5 | 5 | - [constructor](#constructor) |
6 | -- [getInstanceByPath](#getinstancebypath) | |
7 | -- [getInstanceByPort](#getinstancebyport) | |
8 | -- [wait](#wait) | |
6 | +- [addNodeToCheck](#addnodetocheck) | |
7 | +- [getDestPort](#getdestport) | |
8 | +- [getInstance](#getinstance) | |
9 | 9 | - [createInstance](#createinstance) |
10 | 10 | - [createStateRoot](#createstateroot) |
11 | 11 | - [registerContainer](#registercontainer) |
12 | +- [getHashFromObj](#gethashfromobj) | |
12 | 13 | |
13 | 14 | ## constructor |
14 | 15 | |
15 | -[index.js:10-14](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/index.js#L10-L14 "Source code on GitHub") | |
16 | +[index.js:16-22](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L16-L22 "Source code on GitHub") | |
16 | 17 | |
17 | 18 | The Hypervisor manages the container instances by instantiating them and |
18 | 19 | destorying them when possible. It also facilitates localating Containers |
19 | 20 | |
20 | 21 | **Parameters** |
21 | 22 | |
22 | 23 | - `dag` **Graph** an instance of [ipfs.dag](https://github.com/ipfs/interface-ipfs-core/tree/master/API/dag#dag-api) |
24 | +- `state` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the starting state (optional, default `{}`) | |
23 | 25 | |
24 | -## getInstanceByPath | |
26 | +## addNodeToCheck | |
25 | 27 | |
26 | -[index.js:21-28](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/index.js#L21-L28 "Source code on GitHub") | |
28 | +[index.js:28-30](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L28-L30 "Source code on GitHub") | |
27 | 29 | |
28 | -get a container by its path | |
30 | +add a potaintail node in the state graph to check for garbage collection | |
29 | 31 | |
30 | 32 | **Parameters** |
31 | 33 | |
32 | -- `root` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the root container to start searching from | |
33 | -- `path` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the path to travers | |
34 | +- `id` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | |
34 | 35 | |
35 | -## getInstanceByPort | |
36 | +## getDestPort | |
36 | 37 | |
37 | -[index.js:35-46](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/index.js#L35-L46 "Source code on GitHub") | |
38 | +[index.js:37-43](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L37-L43 "Source code on GitHub") | |
38 | 39 | |
39 | -get a contrainer instance given its entry port and its mounting port | |
40 | +given a port, this finds the corridsponeding endpoint port of the channel | |
40 | 41 | |
41 | 42 | **Parameters** |
42 | 43 | |
43 | -- `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the entry port for the container | |
44 | -- `parentPort` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the entry port of the parent container | |
44 | +- `port` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
45 | 45 | |
46 | -## wait | |
46 | +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
47 | 47 | |
48 | -[index.js:56-63](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/index.js#L56-L63 "Source code on GitHub") | |
48 | +## getInstance | |
49 | 49 | |
50 | -given a port, wait untill its source contract has reached the threshold | |
51 | -tick count | |
50 | +[index.js:68-78](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L68-L78 "Source code on GitHub") | |
52 | 51 | |
52 | +gets an existsing container instances | |
53 | + | |
53 | 54 | **Parameters** |
54 | 55 | |
55 | -- `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port to wait on | |
56 | -- `threshold` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of ticks to wait before resolving | |
57 | -- `fromPort` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the entryPort of the container requesting the | |
58 | - wait. Used internally so that waits don't become cyclic | |
56 | +- `id` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the containers ID | |
59 | 57 | |
58 | +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
59 | + | |
60 | 60 | ## createInstance |
61 | 61 | |
62 | -[index.js:73-95](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/index.js#L73-L95 "Source code on GitHub") | |
62 | +[index.js:90-114](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L90-L114 "Source code on GitHub") | |
63 | 63 | |
64 | -creates an instance given the container type, starting state, entry port | |
65 | - and the parentPort | |
64 | +creates an new container instances and save it in the state | |
66 | 65 | |
67 | 66 | **Parameters** |
68 | 67 | |
69 | -- `type` | |
70 | -- `state` | |
71 | -- `entryPort` (optional, default `null`) | |
72 | -- `parentPort` | |
73 | -- `the` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** type of VM to load | |
74 | -- `the` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** starting state of the VM | |
75 | -- `the` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** entry port | |
76 | -- `the` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** parent port | |
68 | +- `type` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the type of container to create | |
69 | +- `code` **any** | |
70 | +- `entryPorts` **[array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** (optional, default `[]`) | |
71 | +- `id` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{nonce:0,parent:null}`) | |
72 | + - `id.nonce` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
73 | + - `id.parent` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
77 | 74 | |
75 | +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
76 | + | |
78 | 77 | ## createStateRoot |
79 | 78 | |
80 | -[index.js:104-107](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/index.js#L104-L107 "Source code on GitHub") | |
79 | +[index.js:122-129](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L122-L129 "Source code on GitHub") | |
81 | 80 | |
82 | 81 | creates a state root starting from a given container and a given number of |
83 | 82 | ticks |
84 | 83 | |
85 | 84 | **Parameters** |
86 | 85 | |
87 | -- `container` **Container** an container instance | |
88 | 86 | - `ticks` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of ticks at which to create the state root |
89 | 87 | |
90 | 88 | Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** |
91 | 89 | |
92 | 90 | ## registerContainer |
93 | 91 | |
94 | -[index.js:114-116](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/index.js#L114-L116 "Source code on GitHub") | |
92 | +[index.js:137-142](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L137-L142 "Source code on GitHub") | |
95 | 93 | |
96 | 94 | regirsters a container with the hypervisor |
97 | 95 | |
98 | 96 | **Parameters** |
99 | 97 | |
100 | -- `type` | |
101 | -- `vm` | |
102 | -- `the` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the type | |
103 | -- `a` **Class** Class for instantiating the container | |
98 | +- `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the type | |
99 | +- `Constructor` **Class** a Class for instantiating the container | |
100 | +- `args` **any** any args that the contructor takes | |
101 | + | |
102 | +## getHashFromObj | |
103 | + | |
104 | +[index.js:149-151](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/index.js#L149-L151 "Source code on GitHub") | |
105 | + | |
106 | +get a hash from a POJO | |
107 | + | |
108 | +**Parameters** | |
109 | + | |
110 | +- `obj` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
111 | + | |
112 | +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** |
docs/index.md | ||
---|---|---|
@@ -1,5 +1,7 @@ | ||
1 | 1 | # API |
2 | 2 | - [Hypervisor](./hypervisor.md) |
3 | -- [exoKernel](./exoKernel.md) | |
4 | -- [portManager](./portManager.md) | |
5 | -- [port](./port.md) | |
3 | +- [Kernel](./kernel.md) | |
4 | +- [PortManager](./portManager.md) | |
5 | + | |
6 | +## internal API's | |
7 | +- [Scheduler](./scheduler.md) |
docs/portManager.md | ||
---|---|---|
@@ -2,131 +2,131 @@ | ||
2 | 2 | |
3 | 3 | ### Table of Contents |
4 | 4 | |
5 | 5 | - [constructor](#constructor) |
6 | -- [start](#start) | |
7 | 6 | - [bind](#bind) |
7 | +- [unbind](#unbind) | |
8 | +- [delete](#delete) | |
9 | +- [clearUnboundedPorts](#clearunboundedports) | |
10 | +- [isBound](#isbound) | |
8 | 11 | - [queue](#queue) |
9 | 12 | - [get](#get) |
10 | -- [delete](#delete) | |
11 | -- [isValidPort](#isvalidport) | |
12 | 13 | - [create](#create) |
13 | -- [wait](#wait) | |
14 | +- [createChannel](#createchannel) | |
14 | 15 | - [getNextMessage](#getnextmessage) |
15 | 16 | |
16 | 17 | ## constructor |
17 | 18 | |
18 | -[portManager.js:41-44](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L41-L44 "Source code on GitHub") | |
19 | +[portManager.js:33-44](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L33-L44 "Source code on GitHub") | |
19 | 20 | |
20 | 21 | The port manager manages the the ports. This inculdes creation, deletion |
21 | 22 | fetching and waiting on ports |
22 | 23 | |
23 | 24 | **Parameters** |
24 | 25 | |
25 | 26 | - `opts` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** |
26 | 27 | - `opts.state` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** |
27 | - - `opts.entryPort` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
28 | - - `opts.parentPort` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
29 | 28 | - `opts.hypervisor` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** |
30 | 29 | - `opts.exoInterface` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** |
31 | 30 | |
32 | -## start | |
31 | +## bind | |
33 | 32 | |
34 | -[portManager.js:51-63](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L51-L63 "Source code on GitHub") | |
33 | +[portManager.js:51-73](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L51-L73 "Source code on GitHub") | |
35 | 34 | |
36 | -starts the port manager. This fetchs the ports from the state and maps | |
37 | -them to thier names | |
35 | +binds a port to a name | |
38 | 36 | |
39 | -Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
37 | +**Parameters** | |
40 | 38 | |
41 | -## bind | |
39 | +- `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the port | |
40 | +- `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port to bind | |
42 | 41 | |
43 | -[portManager.js:75-79](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L75-L79 "Source code on GitHub") | |
42 | +## unbind | |
44 | 43 | |
45 | -binds a port to a name | |
44 | +[portManager.js:80-92](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L80-L92 "Source code on GitHub") | |
46 | 45 | |
46 | +unbinds a port given its name | |
47 | + | |
47 | 48 | **Parameters** |
48 | 49 | |
49 | -- `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port to bind | |
50 | -- `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the port | |
50 | +- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | |
51 | 51 | |
52 | -## queue | |
52 | +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
53 | 53 | |
54 | -[portManager.js:85-87](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L85-L87 "Source code on GitHub") | |
54 | +## delete | |
55 | 55 | |
56 | -queues a message on a port | |
56 | +[portManager.js:98-102](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L98-L102 "Source code on GitHub") | |
57 | 57 | |
58 | +delete an port given the name it is bound to | |
59 | + | |
58 | 60 | **Parameters** |
59 | 61 | |
60 | -- `message` **Message** | |
62 | +- `name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | |
61 | 63 | |
62 | -## get | |
64 | +## clearUnboundedPorts | |
63 | 65 | |
64 | -[portManager.js:94-96](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L94-L96 "Source code on GitHub") | |
66 | +[portManager.js:112-120](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L112-L120 "Source code on GitHub") | |
65 | 67 | |
66 | -gets a port given it's name | |
68 | +clears any unbounded ports referances | |
67 | 69 | |
70 | +## isBound | |
71 | + | |
72 | +[portManager.js:127-129](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L127-L129 "Source code on GitHub") | |
73 | + | |
74 | +check if a port object is still valid | |
75 | + | |
68 | 76 | **Parameters** |
69 | 77 | |
70 | -- `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | |
78 | +- `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
71 | 79 | |
72 | -Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
80 | +Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | |
73 | 81 | |
74 | -## delete | |
82 | +## queue | |
75 | 83 | |
76 | -[portManager.js:102-106](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L102-L106 "Source code on GitHub") | |
84 | +[portManager.js:135-157](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L135-L157 "Source code on GitHub") | |
77 | 85 | |
78 | -deletes a port given its name | |
86 | +queues a message on a port | |
79 | 87 | |
80 | 88 | **Parameters** |
81 | 89 | |
82 | -- `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | |
90 | +- `name` | |
91 | +- `message` **Message** | |
83 | 92 | |
84 | -## isValidPort | |
93 | +## get | |
85 | 94 | |
86 | -[portManager.js:113-115](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L113-L115 "Source code on GitHub") | |
95 | +[portManager.js:164-166](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L164-L166 "Source code on GitHub") | |
87 | 96 | |
88 | -check if a port object is still valid | |
97 | +gets a port given it's name | |
89 | 98 | |
90 | 99 | **Parameters** |
91 | 100 | |
92 | -- `port` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
101 | +- `name` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** | |
93 | 102 | |
94 | -Returns **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | |
103 | +Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
95 | 104 | |
96 | 105 | ## create |
97 | 106 | |
98 | -[portManager.js:122-146](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L122-L146 "Source code on GitHub") | |
107 | +[portManager.js:174-193](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L174-L193 "Source code on GitHub") | |
99 | 108 | |
100 | -creates a new Port given the container type | |
109 | +creates a new container. Returning a port to it. | |
101 | 110 | |
102 | 111 | **Parameters** |
103 | 112 | |
104 | 113 | - `type` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** |
114 | +- `data` **any** the data to populate the initail state with | |
105 | 115 | |
106 | -Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the newly created port | |
116 | +Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
107 | 117 | |
108 | -## wait | |
118 | +## createChannel | |
109 | 119 | |
110 | -[portManager.js:155-167](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L155-L167 "Source code on GitHub") | |
120 | +[portManager.js:199-213](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L199-L213 "Source code on GitHub") | |
111 | 121 | |
112 | -waits till all ports have reached a threshold tick count | |
122 | +creates a channel returns the created ports in an Array | |
113 | 123 | |
114 | -**Parameters** | |
124 | +Returns **[array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** | |
115 | 125 | |
116 | -- `threshold` **Integer** the number of ticks to wait | |
117 | -- `fromPort` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port requesting the wait (optional, default `this.entryPort`) | |
118 | -- `ports` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the ports to wait on (optional, default `[...this._portMap]`) | |
119 | - | |
120 | -Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
121 | - | |
122 | 126 | ## getNextMessage |
123 | 127 | |
124 | -[portManager.js:174-187](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/portManager.js#L174-L187 "Source code on GitHub") | |
128 | +[portManager.js:229-257](https://github.com/primea/js-primea-hypervisor/blob/b507f49239a73767abbee979b4e637a6ca469764/portManager.js#L229-L257 "Source code on GitHub") | |
125 | 129 | |
126 | -gets the next canonical message given the an array of ports to choose from | |
130 | +Waits for the the next message if any | |
127 | 131 | |
128 | -**Parameters** | |
129 | - | |
130 | -- `ports` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** (optional, default `[...this._portMap]`) | |
131 | - | |
132 | 132 | Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** |
docs/exoInterface.md | ||
---|---|---|
@@ -1,107 +1,0 @@ | ||
1 | -<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | |
2 | - | |
3 | -### Table of Contents | |
4 | - | |
5 | -- [constructor](#constructor) | |
6 | -- [start](#start) | |
7 | -- [queue](#queue) | |
8 | -- [run](#run) | |
9 | -- [wait](#wait) | |
10 | -- [incrementTicks](#incrementticks) | |
11 | -- [send](#send) | |
12 | -- [getInstance](#getinstance) | |
13 | - | |
14 | -## constructor | |
15 | - | |
16 | -[exoInterface.js:17-43](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L17-L43 "Source code on GitHub") | |
17 | - | |
18 | -the ExoInterface manages the varous message passing functions and provides | |
19 | -an interface for the containers to use | |
20 | - | |
21 | -**Parameters** | |
22 | - | |
23 | -- `opts` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
24 | - - `opts.state` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
25 | - - `opts.entryPort` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
26 | - - `opts.parentPort` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
27 | - - `opts.hypervisor` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
28 | - - `opts.Container` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** | |
29 | - | |
30 | -## start | |
31 | - | |
32 | -[exoInterface.js:49-51](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L49-L51 "Source code on GitHub") | |
33 | - | |
34 | -starts the container | |
35 | - | |
36 | -Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
37 | - | |
38 | -## queue | |
39 | - | |
40 | -[exoInterface.js:57-64](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L57-L64 "Source code on GitHub") | |
41 | - | |
42 | -adds a message to this containers message queue | |
43 | - | |
44 | -**Parameters** | |
45 | - | |
46 | -- `message` **Message** | |
47 | - | |
48 | -## run | |
49 | - | |
50 | -[exoInterface.js:88-106](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L88-L106 "Source code on GitHub") | |
51 | - | |
52 | -run the kernels code with a given enviroment | |
53 | -The Kernel Stores all of its state in the Environment. The Interface is used | |
54 | -to by the VM to retrive infromation from the Environment. | |
55 | - | |
56 | -**Parameters** | |
57 | - | |
58 | -- `message` | |
59 | - | |
60 | -Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
61 | - | |
62 | -## wait | |
63 | - | |
64 | -[exoInterface.js:113-127](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L113-L127 "Source code on GitHub") | |
65 | - | |
66 | -returns a promise that resolves once the kernel hits the threshould tick count | |
67 | - | |
68 | -**Parameters** | |
69 | - | |
70 | -- `threshold` | |
71 | -- `fromPort` | |
72 | -- `threshould` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of ticks to wait | |
73 | - | |
74 | -Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** | |
75 | - | |
76 | -## incrementTicks | |
77 | - | |
78 | -[exoInterface.js:133-141](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L133-L141 "Source code on GitHub") | |
79 | - | |
80 | -updates the number of ticks that the container has run | |
81 | - | |
82 | -**Parameters** | |
83 | - | |
84 | -- `count` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of ticks to add | |
85 | - | |
86 | -## send | |
87 | - | |
88 | -[exoInterface.js:148-166](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L148-L166 "Source code on GitHub") | |
89 | - | |
90 | -sends a message to a given port | |
91 | - | |
92 | -**Parameters** | |
93 | - | |
94 | -- `portRef` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port | |
95 | -- `message` **Message** the message | |
96 | - | |
97 | -## getInstance | |
98 | - | |
99 | -[exoInterface.js:173-175](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/exoInterface.js#L173-L175 "Source code on GitHub") | |
100 | - | |
101 | -gets a container instance given a port | |
102 | - | |
103 | -**Parameters** | |
104 | - | |
105 | -- `portRef` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the port | |
106 | - | |
107 | -Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** |
docs/port.md | ||
---|---|---|
@@ -1,55 +1,0 @@ | ||
1 | -<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | |
2 | - | |
3 | -### Table of Contents | |
4 | - | |
5 | -- [constructor](#constructor) | |
6 | -- [queue](#queue) | |
7 | -- [peek](#peek) | |
8 | -- [dequeue](#dequeue) | |
9 | -- [size](#size) | |
10 | - | |
11 | -## constructor | |
12 | - | |
13 | -[port.js:7-10](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/port.js#L7-L10 "Source code on GitHub") | |
14 | - | |
15 | -a simple repsentation of a port | |
16 | - | |
17 | -**Properties** | |
18 | - | |
19 | -- `ticks` **Interger** the last know number of ticks the | |
20 | - corrisponding container is at | |
21 | - | |
22 | -## queue | |
23 | - | |
24 | -[port.js:16-19](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/port.js#L16-L19 "Source code on GitHub") | |
25 | - | |
26 | -queues a message on the port | |
27 | - | |
28 | -**Parameters** | |
29 | - | |
30 | -- `message` | |
31 | -- `Message` | |
32 | - | |
33 | -## peek | |
34 | - | |
35 | -[port.js:25-27](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/port.js#L25-L27 "Source code on GitHub") | |
36 | - | |
37 | -returns the message at the front of the queue | |
38 | - | |
39 | -Returns **Message** | |
40 | - | |
41 | -## dequeue | |
42 | - | |
43 | -[port.js:33-35](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/port.js#L33-L35 "Source code on GitHub") | |
44 | - | |
45 | -dequeue a message | |
46 | - | |
47 | -Returns **Message** | |
48 | - | |
49 | -## size | |
50 | - | |
51 | -[port.js:41-43](https://github.com/primea/js-primea-hypervisor/blob/9b7a855ce9b773c9162179ef6cdb3c70739711f0/port.js#L41-L43 "Source code on GitHub") | |
52 | - | |
53 | -returns the size of the queue | |
54 | - | |
55 | -Returns **Integer** |
package.json | ||
---|---|---|
@@ -5,13 +5,13 @@ | ||
5 | 5 | "scripts": { |
6 | 6 | "coverage": "node --harmony ./node_modules/istanbul/lib/cli.js cover ./tests/index.js", |
7 | 7 | "coveralls": "npm run coverage && coveralls <coverage/lcov.info", |
8 | 8 | "lint": "standard", |
9 | - "build:docs": "npm run build:docs:hypervisor && npm run build:docs:exo && npm run build:docs:ports && npm run build:docs:portManager", | |
9 | + "build:docs": "npm run build:docs:hypervisor && npm run build:docs:kernel && npm run build:docs:scheduler && npm run build:docs:portManager", | |
10 | 10 | "build:docs:hypervisor": "documentation build ./index.js --github --shallow --sort-order source -f md > ./docs/hypervisor.md", |
11 | - "build:docs:exo": "documentation build ./exoInterface.js --github --shallow --sort-order source -f md > ./docs/exoInterface.md", | |
12 | - "build:docs:ports": "documentation build ./port.js --github --shallow --sort-order source -f md > ./docs/port.md", | |
11 | + "build:docs:kernel": "documentation build ./kernel.js --github --shallow --sort-order source -f md > ./docs/kernel.md", | |
13 | 12 | "build:docs:portManager": "documentation build ./portManager.js --github --shallow --sort-order source -f md > ./docs/portManager.md", |
13 | + "build:docs:scheduler": "documentation build ./scheduler.js --github --shallow --sort-order source -f md > ./docs/scheduler.md", | |
14 | 14 | "test": "node --harmony ./tests/index.js" |
15 | 15 | }, |
16 | 16 | "repository": { |
17 | 17 | "type": "git", |
Built with git-ssb-web