Skip to content

Commit

Permalink
doc: reference {set,clear}Immediate in Globals
Browse files Browse the repository at this point in the history
setImmediate/clearImmediate are globals, but not mentioned in the
Globals documentation section.
  • Loading branch information
trevnorris committed Mar 21, 2016
1 parent 287bdab commit 8a14d93
Showing 1 changed file with 19 additions and 0 deletions.
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'
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

0 comments on commit 8a14d93

Please sign in to comment.