-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Conversation
}; | ||
L.init(_immediateQueue); | ||
|
||
var processImmediate = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's never reassigned so use function processImmediate() {
here.
Shouldn't |
The semantics of The main difference between Another small difference is that you can pass arguments to the function provided |
Also, setImmediate returns a handle that can be passed to clearImmediate to |
Thanks for clarification! So I assume that apart from obvious API differences (arguments, and clear handle), difference lies in fact that I understand then, that on Node.js ground Do timers logic in some significant way delay execution of (what would be) |
I will try and layout the differences of all the deferral mechanisms including the proposed
|
immediate = L.shift(immediateQueue); | ||
|
||
if (immediate.domain) | ||
immediate.domain.enter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this one line. I say that because if I don't complain about it, @isaacs will - he is like that.
Generally LGTM, both conceptually and implementation-wise, but will need tests and documentation, of course. @isaacs Agreed? |
I have added a test and documentation |
Thanks Timothy, landed in 382f22f. |
thanks! |
This is a basic implementation of setImmediate from https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/setImmediate/Overview.html
I followed the spirit of the async queue, yielding after each iteration. I did not implement the integer id but followed the opaque object from the other timer types.
Tests and documentation will be forthcoming.