Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
doc: general improvements to timers.md#6937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
doc/api/timers.md Outdated
| All of the timer functions are globals. You do not need to `require()` | ||
| this module in order to use them. | ||
| The `timer` module exposes a global API for scheduling callback functions to | ||
| execute at some future period of time. Because the timer functions are globals, |
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.
execute is "one-off", period would rather indicate a sequence of time, no? Anyhow this sounds a little bulky.
eljefedelrodeodeljefe commented May 23, 2016
Generally LGTM. Good work. |
doc/api/timers.md Outdated
| Returns the timer. | ||
| Returns a reference to the timer object. | ||
| [the Node.js Event Loop]: ../topics/the-event-loop-timers-and-nexttick.html |
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.
Are you sure this works?
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.
Not yet. Will be double checking the links before landing.
On May 23, 2016 3:57 PM, "Anna Henningsen" [email protected] wrote:
In doc/api/timers.md
#6937 (comment):+[the Node.js Event Loop]: ../topics/the-event-loop-timers-and-nexttick.html
Are you sure this works?
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/nodejs/node/pull/6937/files/a8c72718f4500daa613cfe84416f19e8664f6378#r64303631
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.
I don't think so
mscdex commented May 24, 2016
/cc @Fishrock123 |
doc/api/timers.md Outdated
| By default, when a timer is scheduled using either `setTimeout()` or | ||
| `setInterval()`, the Node.js event loop will continue running as long as the | ||
| timer is active. Each of the opaque timer objects returned by these functions |
Fishrock123May 24, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
"opaque" should be something along the lines of "internally tracked" or something
i.e. no access to a _handle
Fishrock123 commented May 24, 2016
jasnell commented May 24, 2016
bengl commented May 27, 2016
@jasnell Yeah sure. You want me to PR against your branch or you got it? |
jasnell commented May 27, 2016
Either way works!
|
bengl commented May 27, 2016
@jasnell alright I made a PR against your branch with roughly the same changes (it was easier to do a completely commit than to rebase). |
jasnell commented May 28, 2016
Awesome, thank you. Squashed my commits and pulled yours in. |
jasnell commented May 28, 2016
@bengl ... made a few additional edits on top .. PTAL |
bengl commented May 28, 2016
LGTM |
benjamingr commented May 28, 2016
LGTM |
doc/api/timers.md Outdated
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.
Has no effect unless the Timeout was previously unrefed.
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.
Also this does not restore overhead lost by calling unref() -- once you unref it, we'd have to do a linear walk to re-insert it.
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.
Neither of these comments seem to be necessary to add to the user documentation in this PR.
jasnell commented Jun 2, 2016
Updated. PTAL |
jasnell commented Jun 3, 2016
If there are no further comments, I will land on Monday |
doc/api/timers.md Outdated
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.
Not incorrect, but I think this is still poorly worded.
When called, the
Timeoutwill not keep the event loop open. When Node.js would exit due to inactivity, this timer will longer be considered as activity, and the program may stop before it calls it's callback.
Maybe that would be better? I agree the wording is hard without having a strong idea of the event loop and handle refedness.
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.
I'm not sure that's any better. Rather than hold this up while we get the wording perfect on this, I'd recommend landing and iterating on it separately in subsequent PRs
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.
Hmmm, perhaps, but it should probably at least indicate it has an effect on when the process exits. Perhaps the original wording is the best compromise for now then?
Fishrock123 commented Jun 3, 2016
LGTM minus nits (particularly the last one) |
Fishrock123 commented Jun 15, 2016
ping @jasnell |
jasnell commented Jun 15, 2016
Will be back on this after I'm back from vacation
|
jasnell commented Jun 21, 2016
Updated one final time to address nit |
doc/api/globals.md Outdated
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.
I think this link is incorrect?
Fishrock123 commented Jun 27, 2016
LGTM, might want to make sure the link is right though. The other bits can always be addressed in a new PR |
jasnell commented Jun 27, 2016
Updated to address the final round of nits |
Fishrock123 commented Jun 28, 2016
Seems good, let's land and unblock #6956 |
Overall improvements to timers.md documentation, Includes squashed commit from @bengl: doc: add timer classes The timers returned by `setTimeout` and friends are actually instances of `Timeout` and `Immediate`. Documenting them as such, so that the `ref` and `unref` methods can be identified as methods on `Timeout` objects. Sparked by discussion in nodejs#5792
Overall improvements to timers.md documentation, Includes squashed commit from @bengl: doc: add timer classes The timers returned by `setTimeout` and friends are actually instances of `Timeout` and `Immediate`. Documenting them as such, so that the `ref` and `unref` methods can be identified as methods on `Timeout` objects. Sparked by discussion in #5792 PR-URL: #6937 Reviewed-By: Robert Jefe Lindstaedt <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
jasnell commented Jun 28, 2016
Landed in 86e07b7 |
Overall improvements to timers.md documentation, Includes squashed commit from @bengl: doc: add timer classes The timers returned by `setTimeout` and friends are actually instances of `Timeout` and `Immediate`. Documenting them as such, so that the `ref` and `unref` methods can be identified as methods on `Timeout` objects. Sparked by discussion in #5792 PR-URL: #6937 Reviewed-By: Robert Jefe Lindstaedt <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Checklist
Affected core subsystem(s)
doc (timers)
Description of change
General improvements to timers.md copy
@nodejs/documentation