4. Using Events, Listeners, Timers, and Callbacks in Node.js

Node.js provides scalability and performance through its powerful event-driven model. This chapter focuses on understanding the model and how it differs from traditional threading models used by most webservers. Understanding the event model is critical because it may force you to change your design thinking for your applications. However, those changes will be well worth the improvements in speed that you get by using Node.js.

This chapter also covers the different methods you use to add work to the Node.js event queue. You can add work by using event listeners or timers, or you can schedule work directly. In this chapter you’ll also learn how to implement events in your own custom ...

Get Node.js, MongoDB, and AngularJS Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.