Immediate 类
此对象是在 setImmediate()
内部创建并返回。
它可以传给 clearImmediate()
以取消调度的行动。
默认情况下,当立即调度时,只要立即处于活动状态,则 Node.js 事件循环就会继续运行。
setImmediate()
返回的 Immediate
对象导出可用于控制此默认行为的 immediate.ref()
和 immediate.unref()
函数。
This object is created internally and is returned from setImmediate()
. It
can be passed to clearImmediate()
in order to cancel the scheduled
actions.
By default, when an immediate is scheduled, the Node.js event loop will continue
running as long as the immediate is active. The Immediate
object returned by
setImmediate()
exports both immediate.ref()
and immediate.unref()
functions that can be used to control this default behavior.