更新时间:2021-07-30 09:48:54
封面
版权页
Credits
About the Author
About the Reviewer
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Chapter 1. Why JavaScript Concurrency?
Synchronous JavaScript
Types of concurrency
JavaScript concurrency principles: Parallelize Synchronize Conserve
Summary
Chapter 2. The JavaScript Execution Model
Everything is a task
Execution contexts
Creating tasks using timers
Responding to DOM events
Responding to network events
Concurrency challenges with this model
Chapter 3. Synchronizing with Promises
Promise terminology
Resolving and rejecting promises
Reacting to promises
Building callback chains
Synchronizing several promises
Promises without executors
Chapter 4. Lazy Evaluation with Generators
Call stacks and memory allocation
Creating generators and yielding values
Infinite sequences
Deferring to other generators
Passing data to generators
Coroutines
Chapter 5. Working with Workers
What are workers?
Types of workers
Worker environments
Communicating with workers
Sharing application state
Performing sub-tasks with sub-workers
Error handling in web workers
Chapter 6. Practical Parallelism
Functional programming
Do we need to go parallel?
Candidate problems
Keeping the DOM responsive
Chapter 7. Abstracting Concurrency
Writing concurrent code
Worker communication with promises
Lazy workers
Using Parallel.js
Worker pools
Chapter 8. Evented IO with NodeJS
Single threaded IO
More connections more problems
Evented network IO
Evented file IO
Chapter 9. Advanced NodeJS Concurrency
Coroutines with Co
Child Processes
Process Clusters
Server clusters
Chapter 10. Building a Concurrent Application
Getting started
Requirements
Building the API
Building the UI
Additions and improvements
Index