debug improved

This commit is contained in:
Wolfgang Hottgenroth
2017-08-28 12:39:53 +02:00
parent 9356a81fd1
commit 5b909f5a7a
8 changed files with 55 additions and 47 deletions

5
dist/callchain.js vendored
View File

@ -23,6 +23,7 @@ class AChainItem extends events.EventEmitter {
this.next = next;
}
send(message) {
log.info(`Calling ${this.label} with ${message}`);
this.emit('yourturn', message);
}
}
@ -36,7 +37,7 @@ class AAsyncBaseChainItem extends AChainItem {
this.next.begin();
}
this.addListener('yourturn', (message) => {
log.info(`Calling ${this.toString()}`);
log.info(`Executing ${this.toString()}`);
this.func(message, this.next.send);
});
}
@ -51,7 +52,7 @@ class ABaseChainItem extends AChainItem {
this.next.begin();
}
this.addListener('yourturn', (message) => {
log.info(`Calling ${this.toString()}`);
log.info(`Executing ${this.toString()}`);
let result = this.func(message);
this.next.send(result);
});