tests/index.jsView |
---|
9 | 9 | start: false |
10 | 10 | }) |
11 | 11 | |
12 | 12 | class BaseContainer extends AbstractContainer { |
13 | | - initialize (message) { |
| 13 | + onInitialize (message) { |
14 | 14 | this.kernel.state.code = message.data.byteLength ? message.data : undefined |
15 | 15 | const port = message.ports[0] |
16 | 16 | if (port) { |
17 | 17 | this.kernel.ports.bind('root', port) |
61 | 61 | '/': 'zdpuAozDi6tKPbqmHJxo7aNES2xVt1MkaCLyxcioEKzz3M2WH' |
62 | 62 | } |
63 | 63 | |
64 | 64 | class testVMContainer extends BaseContainer { |
65 | | - initialize () {} |
| 65 | + onInitialize () {} |
66 | 66 | } |
67 | 67 | |
68 | 68 | const hypervisor = new Hypervisor(node.dag) |
69 | 69 | hypervisor.registerContainer('test', testVMContainer) |
506 | 506 | } |
507 | 507 | } |
508 | 508 | |
509 | 509 | class Waiter extends BaseContainer { |
510 | | - initialize () { |
| 510 | + onInitialize () { |
511 | 511 | return new Promise((resolve, reject) => { |
512 | 512 | setTimeout(() => { |
513 | 513 | resolve() |
514 | 514 | }, 200) |
873 | 873 | } |
874 | 874 | } |
875 | 875 | |
876 | 876 | class Sub extends BaseContainer { |
877 | | - initailize (message) { |
| 877 | + onInitailize (message) { |
878 | 878 | this.kernel.ports.bind('root', message.ports[0]) |
879 | 879 | const [portRef1, portRef2] = root.ports.createChannel() |
880 | 880 | root.ports.bind('child', portRef1) |
881 | 881 | root.createInstance('root', root.createMessage({ |