Github user itaifrenkel commented on the pull request:
https://github.com/apache/incubator-storm/pull/177#issuecomment-50172761
On your first comment:
Node.js APIs have their own standard for asynchronous functions:errors are
passed as the first argument to the callback function. See for example
http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback
Since the ISpout and IBolt methods are "void methods" the nodejs callback
equivalent only receives one argument (error if exists) and does not receive a
second argument (return value). Hence this method may sometimes be called
"done" instead of "callback".
Another approach would be to use Promise objects (such as whenjs), however
these means adding an opinionated dependency. Most promise libraries have
"lift" method that converts standard nodejs async functions into their promise
equivalents.
Another approach would be using the nodejs on event pattern, but we tried
to stick to the python implementation as much as we could, so we haven not
considered it.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---