-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Description
Now in node we have callback or EventEmitter model to deal with async calls by default. But in my opinion it is better if every async function returns a native Promise (from new version of V8).
It does not break backward compatibility and supports optional callback if needed.
If so we just do not need to install additional package for promises like q or bluebird except additional functionality is needed.
_EDIT 2014-12-11 by @rvagg_
Comment lifted from here so it's easier to see for newcomers to this conversation.
This was discussed at the TC meeting yesterday, see #144, the aim was to be able to provide at least some kind of statement as feedback in this issue. I don't think the issue needs to be closed and can continue to collect discussion from those who feel strongly about this topic.
The feedback from the TC about incorporating a Promises-based API in core goes something like this:
A Promises API doesn’t make sense for core right now because it's too early in the evolution of V8-based promises and their relationship to other ES* features. There is very little interest within the TC in exploring this in core in the short-term.
However, the TC is open to change as the feature specifications and implementations in ES6 and ES7 are worked out. The TC is open to experimentation and providing the most optimal API for users, which may potentially include a Promises-based API, particularly if newer features of JavaScript work most optimally in conjunction with Promises. The speed of the language specification process and V8 implementation will mostly dictate the timeline.
It should be noted that a callback API is unlikely to ever go away.