git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 7c1b9abb1401216b0a7325dfb2213933eda8826a

Merge pull request #12 from dfinity/debug

add debug
Norton Wang authored on 5/8/2018, 4:32:11 PM
GitHub committed on 5/8/2018, 4:32:11 PM
Parent: 65253852ce4bba2ee5342f055ebaf1a4a27d6ffe
Parent: e017d4e42f620b5ba0800e23649089033808a860

Files changed

actor.jschanged
index.jschanged
package-lock.jsonchanged
package.jsonchanged
actor.jsView
@@ -1,6 +1,7 @@
11 const errors = require('./errors.json')
22 const nope = () => {}
3 +const debug = require('debug')('lifecycle:error')
34
45 module.exports = class Actor {
56 /**
67 * the Actor manages the various message passing functions and provides
@@ -54,8 +55,9 @@
5455 try {
5556 this.currentMessage = message
5657 await this.container.onMessage(message)
5758 } catch (e) {
59 + debug(e)
5860 message.emit('execution:error', e)
5961 }
6062 message.emit('done', this)
6163 }
index.jsView
@@ -2,8 +2,10 @@
22 const Actor = require('./actor.js')
33 const Scheduler = require('./scheduler.js')
44 const {decoder, generateId, ModuleRef, ActorRef} = require('primea-objects')
55
6 +const debug = require('debug')('lifecycle:createActor')
7 +
68 module.exports = class Hypervisor {
79 /**
810 * The Hypervisor manages module instances by instantiating them and
911 * destroying them when possible. It also facilitates locating Containers
@@ -100,8 +102,10 @@
100102 */
101103 createActor (modRef, id = {nonce: this.nonce++, parent: null}) {
102104 const actorId = generateId(id)
103105 const metaData = [modRef.type, 0]
106 + debug('new id', actorId.toJSON())
107 + debug(modRef.toJSON())
104108
105109 // save the container in the state
106110 this.tree.set(actorId.id, metaData).then(node => {
107111 // save the code
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 350853 bytes
New file size: 353282 bytes
package.jsonView
@@ -29,8 +29,9 @@
2929 "contributors": "Alex Beregszaszi <alex@rtfs.hu>",
3030 "license": "MPL-2.0",
3131 "dependencies": {
3232 "binary-search-insert": "^1.0.3",
33 + "debug": "^3.1.0",
3334 "events": "^2.0.0",
3435 "primea-objects": "0.0.9",
3536 "safe-buffer": "^5.1.2"
3637 },

Built with git-ssb-web