Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/internal/process/next_tick.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

const kMaxCallbacksPerTick = 1e4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with the const, but the name needs to be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I've changed the name of the const now and also added a comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trevnorris Does the latest change look alright to you? Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh. Sorry. I wasn't being literal in the name kMaxCallbacksUntilQueueIsShortened. For an actual name, possibly kMaxCallbacksPerLoop. Though I won't wait until you make the change to sign-off so you won't have to wait for me.


exports.setup = setupNextTick;

function setupNextTick() {
Expand Down Expand Up @@ -96,7 +98,7 @@ function setupNextTick() {
// callback invocation with small numbers of arguments to avoid the
// performance hit associated with using `fn.apply()`
_combinedTickCallback(args, callback);
if (1e4 < tickInfo[kIndex])
if (kMaxCallbacksPerTick < tickInfo[kIndex])
tickDone();
}
tickDone();
Expand All @@ -120,7 +122,7 @@ function setupNextTick() {
// callback invocation with small numbers of arguments to avoid the
// performance hit associated with using `fn.apply()`
_combinedTickCallback(args, callback);
if (1e4 < tickInfo[kIndex])
if (kMaxCallbacksPerTick < tickInfo[kIndex])
tickDone();
if (domain)
domain.exit();
Expand Down