Commit 3d626f29b0f27acc0e9f297661d65f4b51b6823c
Initial version
Alex Beregszaszi committed on 7/21/2017, 7:32:57 PMFiles changed
README.md | added |
index.js | added |
package.json | added |
README.md | ||
---|---|---|
@@ -1,0 +1,11 @@ | ||
1 … | +# SYNOPSIS | |
2 … | + | |
3 … | +[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard) | |
4 … | + | |
5 … | +Abstract Primea container. | |
6 … | + | |
7 … | +# INSTALL | |
8 … | +clone and run `npm install` | |
9 … | + | |
10 … | +# LICENSE | |
11 … | +[MPL-2.0](https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)) |
index.js | ||
---|---|---|
@@ -1,0 +1,23 @@ | ||
1 … | +class AbstractContainer { | |
2 … | + // the constructor is given an instance of the kernel | |
3 … | + // https://github.com/primea/js-primea-hypervisor/blob/master/docs/kernel.md | |
4 … | + constructor (kernel) { | |
5 … | + this.kernel = kernel | |
6 … | + } | |
7 … | + | |
8 … | + // this method runs once when the container is initially created. It is given | |
9 … | + // a message with a single port, which is a channel to its parent with the | |
10 … | + // exception of the root container (the container that is intailial created) | |
11 … | + initialize (message) { | |
12 … | + throw new Error('Unimplemented initialiser') | |
13 … | + } | |
14 … | + | |
15 … | + // the function is called for each message that a container gets | |
16 … | + run (message) { | |
17 … | + throw new Error('Unimplemented message: ' + message.data) | |
18 … | + } | |
19 … | + | |
20 … | + onIdle () { | |
21 … | + this.kernel.shutdown() | |
22 … | + } | |
23 … | +} |
package.json | ||
---|---|---|
@@ -1,0 +1,28 @@ | ||
1 … | +{ | |
2 … | + "name": "primea-abstract-container", | |
3 … | + "version": "0.0.0", | |
4 … | + "description": "Abstract Primea container", | |
5 … | + "scripts": { | |
6 … | + "lint": "standard" | |
7 … | + }, | |
8 … | + "repository": { | |
9 … | + "type": "git", | |
10 … | + "url": "git+https://github.com/primea/js-primea-container.git" | |
11 … | + }, | |
12 … | + "bugs": { | |
13 … | + "url": "https://github.com/primea/js-primea-container/issues" | |
14 … | + }, | |
15 … | + "homepage": "https://github.com/primea/js-primea-container", | |
16 … | + "keywords": [ | |
17 … | + "primea", | |
18 … | + "container", | |
19 … | + "kernel" | |
20 … | + ], | |
21 … | + "author": "mjbecze <mjbecze@gmail.com>", | |
22 … | + "contributors": "Alex Beregszaszi <alex@rtfs.hu>", | |
23 … | + "license": "MPL-2.0", | |
24 … | + "devDependencies": { | |
25 … | + "standard": "10.0.2", | |
26 … | + "tape": "^4.5.1" | |
27 … | + } | |
28 … | +} |
Built with git-ssb-web