Concurrency in TypeScript
300 pages
English
PDF
4.5

Concurrency in TypeScript

Concurrency in TypeScript

Author:

Year:

Summary:

Modern web development is unthinkable without efficient handling of concurrent tasks. The book "Concurrency in TypeScript" is a practical guide that will help you master all aspects of asynchronous and parallel programming in TypeScript, from the basics to advanced techniques.



Who is this book for?

  • Frontend and backend developers using TypeScript;
  • Developers transitioning from JavaScript to TypeScript who want to deepen their understanding of concurrency;
  • Engineers working with Node.js and browser applications where performance is critical;
  • Students and professionals preparing for technical interviews on complex topics.


What you will learn:

  • How the Event Loop works in the browser and Node.js, and how it affects code execution;
  • Deep dive into Promises, chaining, and error handling;
  • The async/await syntax and its internal workings with examples;
  • Using Web Workers for true multithreading in the browser;
  • Working with SharedArrayBuffer and Atomics for memory sharing between threads;
  • Concurrent programming patterns: Producer-Consumer, Pipeline, Fork-Join;
  • Threads in Node.js (worker_threads) and their integration with TypeScript;
  • Typing asynchronous operations: custom types, generics, and utilities;
  • Dealing with race conditions, deadlocks, and other typical concurrency issues;
  • Testing asynchronous code with Jest and Mocha;
  • Performance: benchmarking, profiling, and optimization.


Book features:

  • Each chapter contains practical examples and ready-to-run code listings;
  • Exercises with solutions to reinforce the material;
  • Comparison of approaches: callbacks vs promises vs async/await vs threads;
  • Use of modern TypeScript features (conditional types, template literal types);
  • The book is suitable for both browser applications (React, Angular, Vue) and server-side applications (NestJS, Express).


Examples from the book: you will learn to create asynchronous task queues, implement parallel data loading with progress, build high-load servers with a worker pool, and write safe multithreaded code.



This book will become your desktop reference on all matters of concurrency in TypeScript. Regardless of your current level, you will find valuable knowledge here that you can immediately apply in real-world projects.

Recommendations