Files: 4abc5f9ec71beac0381b08cc3d09a60d65be1856 / hypervisor.js
548 bytesRaw
1 | const Kernel = require('./index.js') |
2 | const codeHandlers = require('./codeHandler.js') |
3 | |
4 | module.exports = class Hypervisor { |
5 | constructor (graph, state, imports = []) { |
6 | this.state = state |
7 | this.graph = graph |
8 | this.root = new Kernel({ |
9 | imports: imports, |
10 | graph: graph, |
11 | state: state |
12 | }) |
13 | } |
14 | |
15 | set (path, value) { |
16 | return this.graph.set(this.state, path, value) |
17 | } |
18 | |
19 | send (portName, message) { |
20 | return this.root.send(portName, message) |
21 | } |
22 | |
23 | addVM (type, handler) { |
24 | codeHandlers.handlers.type = handler |
25 | } |
26 | } |
27 |
Built with git-ssb-web