Web Workers: Multithreaded Programs in JavaScript (Paperback)
暫譯: Web Workers:JavaScript 的多執行緒程式設計 (平裝本)

Ido Green

  • 出版商: O'Reilly
  • 出版日期: 2012-07-03
  • 售價: $1,040
  • 貴賓價: 9.5$988
  • 語言: 英文
  • 頁數: 62
  • 裝訂: Paperback
  • ISBN: 1449322131
  • ISBN-13: 9781449322137
  • 相關分類: JavaScript
  • 海外代購書籍(需單獨結帳)

買這商品的人也買了...

商品描述

Web apps would run much better if heavy calculations could be performed in the background, rather than compete with the user interface. With this book, you’ll learn how to use Web Workers to run computationally intensive JavaScript code in a thread parallel to the UI. Yes, multi-threaded programing is complicated, but Web Workers provide a simple API that helps you be productive without the complex algorithms.

If you have an intermediate to advanced understanding of JavaScript— especially event handling and callbacks—you’re ready to tackle Web Workers with the tools in this example-driven guide.

  • Start creating Web Workers and understand what they can and can’t do
  • Determine which browser versions support the API
  • Use dedicated Web Workers for tasks that consume a lot of CPU, such as data parsing
  • Explore use cases for creating inline Workers, such as encapsulating a web app in one page
  • Create a shared Worker to communicate multiple web app instances to the server, and other uses
  • Learn best practices for debugging Web Workers
  • Apply Web Workers within the server-side Node environment

商品描述(中文翻譯)

網頁應用程式如果能在背景中執行繁重的計算,而不是與使用者介面競爭,將會運行得更好。在這本書中,您將學習如何使用 Web Workers 在與 UI 平行的執行緒中運行計算密集型的 JavaScript 代碼。是的,多執行緒編程是複雜的,但 Web Workers 提供了一個簡單的 API,幫助您在不需要複雜算法的情況下提高生產力。

如果您對 JavaScript 有中級到高級的理解,特別是事件處理和回調,您就已經準備好使用這本以範例為主的指南來處理 Web Workers。

- 開始創建 Web Workers,了解它們能做什麼和不能做什麼
- 確定哪些瀏覽器版本支持該 API
- 使用專用的 Web Workers 處理消耗大量 CPU 的任務,例如數據解析
- 探索創建內聯 Workers 的使用案例,例如將網頁應用程式封裝在一個頁面中
- 創建共享 Worker 以將多個網頁應用程式實例與伺服器進行通信,以及其他用途
- 學習調試 Web Workers 的最佳實踐
- 在伺服器端的 Node 環境中應用 Web Workers