- Mastering Node.js(Second Edition)
- Sandro Pasquali Kevin Faaborg
- 147字
- 2021-07-02 19:28:44
setImmediate
setImmediate is technically a member of the class of timers, along with setInterval and setTimeout . However, there is no sense of time associated with it — there is no number of milliseconds to wait for an argument to be sent.
This method is really more of a sibling to process.nextTick, differing in one very important way: while callbacks queued by nextTick will execute before I/O and timer events, callbacks queued by setImmediate will be called after I/O events.
The naming of these two methods is confusing: Node will actually run the function you give to nextTick before the one you pass to setImmediate.
This method does reflect the standard behavior of timers in that its invocation will return an object that can be passed to clearImmediate, cancelling your request to run your function later on in the same way clearTimeout cancels timers set with setTimeout.
- 網絡協議工程
- 從區塊鏈到Web3:構建未來互聯網生態
- 工業控制網絡安全技術與實踐
- Django 2 by Example
- 2018網信發展報告
- Microsoft Dynamics CRM 2011 Applications(MB2-868) Certification Guide
- 網絡環境中基于用戶視角的信息質量評價研究
- SAE原理與網絡規劃
- 語音信號處理及Blackfin DSP實現
- Getting Started with nopCommerce
- Practical Web Penetration Testing
- 深入理解Nginx:模塊開發與架構解析
- 基于IPv6的家居物聯網開發與應用技術
- Professional Scala
- NB-IoT原理和優化