Skip to Content
Node.js Design Patterns - Third Edition
book

Node.js Design Patterns - Third Edition

by Mario Casciaro, Luciano Mammino
July 2020
Intermediate to advanced
664 pages
15h 24m
English
Packt Publishing
Content preview from Node.js Design Patterns - Third Edition

3

Callbacks and Events

In synchronous programming, we conceptualize code as a series of consecutive computing steps that solve a specific problem. Every operation is blocking, which means that only when an operation is completed, it is possible to execute the next one. This approach makes the code very easy to read, understand, and debug.

On the other side, in asynchronous programming, some operations, such as reading from a file or performing a network request, are launched and then executed "in the background." When we invoke an asynchronous operation, the instruction that follows is executed immediately, even if the previous asynchronous operation has not finished yet. In this scenario, we need a way to get notified when an asynchronous operation ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Complete Node.js Developer Course (3rd Edition)

The Complete Node.js Developer Course (3rd Edition)

Andrew Mead, Codestars By Rob Percival
Node.js - The Complete Guide

Node.js - The Complete Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839214110Supplemental Content