Updated Design: Node Messaging API (markdown)

Hiroyasu Nishiyama 2018-07-08 22:11:39 +09:00
parent 9581063590
commit 93b91ec2b7
1 changed files with 9 additions and 0 deletions

@ -135,3 +135,12 @@ this.on('input', function(msg) {
- this relies on the user passing msg through - something that could be a source of programming error.
- it would need clear semantics over when it was called and how it relates to `node.error`.
### Proposal of `function` node extension for Node Messaging API (HN)
In order to add support for the new style message handler, We propose following extension for `function` node.
- add `send` and `done` variable that correspond to newly introduced arguments of new style message handler,
- add `node.setTimeout` function for specifying node timeout in milliseconds.
For compatibility with the old style message handler, we expect old style handler is used for `function` node in default (no need for calling `done` callback function).
The new style handler can be activated by calling `node.useNewStyleHandler()` or selecting checkbox of setting panel of `function` node.