Skip to main content
Top

2013 | OriginalPaper | Chapter

3. The Node Programming Model

Author : Colin J. Ihrig

Published in: Pro Node.js for Developers

Publisher: Apress

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Before trying to write any meaningful Node applications, it's important to understand what's going on under the hood. Probably the most important thing to understand is that JavaScript—and Node by extension—is single threaded. This means that Node applications can do exactly one thing at a time. However, JavaScript can give the illusion of being multithreaded through the use of an event loop. The event loop is used to schedule tasks in Node's event-driven programming model. Each time an event occurs, it is placed in Node's event queue. In each iteration of the event loop, a single event is dequeued and processed. If, during processing, this event creates any additional events, they are simply added to the end of the queue. When the event is completely handled, control is returned to the event loop, and another event is processed.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Metadata
Title
The Node Programming Model
Author
Colin J. Ihrig
Copyright Year
2013
Publisher
Apress
DOI
https://doi.org/10.1007/978-1-4302-5861-2_3

Premium Partner