Skip to content
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

doc: reference {set,clear}Immediate in Globals #5830

Closed
wants to merge 1 commit into from
Closed
Changes from all 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
19 changes: 19 additions & 0 deletions doc/api/globals.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ console.log(__filename);

`__filename` isn't actually a global but rather local to each module.

## clearImmediate(immediateObject)

Stops an `immediateObject`, as created by [`setImmediate`][], from triggering.

## clearInterval(t)

Stop a timer that was previously created with [`setInterval()`][]. The callback
Expand Down Expand Up @@ -162,6 +166,21 @@ left untouched.
Use the internal `require()` machinery to look up the location of a module,
but rather than loading the module, just return the resolved filename.

## setImmediate(callback[, arg][, ...])

To schedule the "immediate" execution of `callback` after I/O events'
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you change "To schedule" to "Schedules".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is copied verbatum from the timers documentation. If changed in one place should change in another. That alright?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh. Yea.

callbacks and before timers set by [`setTimeout`][] and [`setInterval`][] are
triggered. Returns an `immediateObject` for possible use with
[`clearImmediate`][]. Additional optional arguments may be passed to the
callback.

Callbacks for immediates are queued in the order in which they were created.
The entire callback queue is processed every event loop iteration. If an
immediate is queued from inside an executing callback, that immediate won't fire
until the next event loop iteration.

If `callback` is not a function `setImmediate()` will throw immediately.

## setInterval(cb, ms)

Run callback `cb` repeatedly every `ms` milliseconds. Note that the actual
Expand Down