<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Andres Diaz</title>
    <description>The latest articles on DEV Community by Andres Diaz (@vagostep).</description>
    <link>https://dev.to/vagostep</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3170642%2Ff8617645-17c0-4e87-ae7d-192e44f5709e.jpg</url>
      <title>DEV Community: Andres Diaz</title>
      <link>https://dev.to/vagostep</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vagostep"/>
    <language>en</language>
    <item>
      <title>Node.js Event Loop Visualized Series</title>
      <dc:creator>Andres Diaz</dc:creator>
      <pubDate>Fri, 23 May 2025 15:34:01 +0000</pubDate>
      <link>https://dev.to/vagostep/nodejs-event-loop-visualized-series-3g4</link>
      <guid>https://dev.to/vagostep/nodejs-event-loop-visualized-series-3g4</guid>
      <description>&lt;h2&gt;
  
  
  Understanding Timeout
&lt;/h2&gt;

&lt;p&gt;In the first post of this series, we introduced the Node.js Event Loop Visualizer—a powerful tool that shows exactly how asynchronous operations are handled in real time. Now, it’s time to get hands-on.&lt;/p&gt;

&lt;p&gt;This article focuses on setTimeout, one of the most common asynchronous functions in JavaScript. But instead of diving into theory, we invite you to watch it in action.&lt;/p&gt;

&lt;h2&gt;
  
  
  See It in Real Time
&lt;/h2&gt;

&lt;p&gt;What actually happens when you call setTimeout? How does Node.js decide when to run your callback? These are questions best answered by seeing the Event Loop in motion.&lt;/p&gt;

&lt;p&gt;Head over to the Event Loop Visualizer, paste in a simple setTimeout snippet, and hit run. You’ll get a clear visual of how your timer is registered, queued, and eventually executed. No guesswork, no abstraction—just the real execution flow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3v9v0r5ma4betuw5xnfh.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3v9v0r5ma4betuw5xnfh.gif" alt="Event Loop Visualizer With Timeout example" width="760" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Watch For
&lt;/h2&gt;

&lt;p&gt;As you explore, pay attention to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When your setTimeout callback appears in the Timers queue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How delays are interpreted and when execution actually begins.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How other tasks can shift the timing of your callback.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The interaction between the call stack, queues, and Event Loop phases.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Experiment Yourself
&lt;/h2&gt;

&lt;p&gt;Try adjusting the delay time. Add multiple timers. Mix in blocking code or other asynchronous patterns. The visualizer responds instantly to your changes, helping you build a real, working mental model of how things behave.&lt;/p&gt;

&lt;p&gt;Start exploring here: &lt;a href="https://vagostep.github.io/Node-EventLoop-Visualizer/" rel="noopener noreferrer"&gt;Node.js Event Loop Visualizer&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>eventloop</category>
    </item>
    <item>
      <title>Node.js Event Loop Visualized Series</title>
      <dc:creator>Andres Diaz</dc:creator>
      <pubDate>Fri, 16 May 2025 17:09:32 +0000</pubDate>
      <link>https://dev.to/vagostep/nodejs-event-loop-visualized-series-2fip</link>
      <guid>https://dev.to/vagostep/nodejs-event-loop-visualized-series-2fip</guid>
      <description>&lt;p&gt;Have you ever wondered how Node.js handles asynchronous operations so efficiently? The secret lies in the Event Loop, a core component that orchestrates the execution of tasks. In this series, "Node.js Event Loop Visualized," we will dive deep into the inner workings of the Event Loop using a powerful tool: the Event Loop Visualizer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Event Loop Visualizer?
&lt;/h2&gt;

&lt;p&gt;The Event Loop Visualizer is a tool I've been working with, based on a fork of an existing project. It offers a unique insight into the real execution of the Event Loop by utilizing a modified version of the Node.js core. Unlike other tutorials, courses, and posts that often rely on simulations to explain the Event Loop, this tool captures the actual execution, recording each phase in real-time. This provides a clearer and more accurate understanding of how Node.js manages tasks and events.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0633ff2lkseu5920hhch.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0633ff2lkseu5920hhch.gif" alt="Node.js Event Loop Visualizer" width="760" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to explore the &lt;a href="https://vagostep.github.io/Node-EventLoop-Visualizer/" rel="noopener noreferrer"&gt;Event Loop Visualizer&lt;/a&gt; and see it in action for yourself!&lt;/p&gt;

&lt;h2&gt;
  
  
  Components of the Event Loop Visualizer
&lt;/h2&gt;

&lt;p&gt;The Event Loop Visualizer is composed of several key sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code Editor&lt;/strong&gt;: Write and execute JavaScript code to see how it interacts with the Event Loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Macrotask and Microtask Queues&lt;/strong&gt;: Visualize how tasks are queued and processed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Call Stack&lt;/strong&gt;: Observe the current call stack and how functions are executed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event Loop Phases&lt;/strong&gt;: Track the different phases of the Event Loop, such as Timers, Poll, and Check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ticks &amp;amp; Rejections Loop Phases&lt;/strong&gt;: Understand how Node.js handles next ticks and microtasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metrics&lt;/strong&gt;: Monitor loop counts and event processing statistics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simulated Terminal&lt;/strong&gt;: View real-time output from your code execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to Expect in This Series
&lt;/h2&gt;

&lt;p&gt;In each post of this series, we will analyze a specific block of code and explore how it is executed within the Event Loop. We'll cover a range of examples, from basic like timers to more advanced such as handling sockets and streams.&lt;/p&gt;

&lt;p&gt;Stay tuned as we embark on this journey to demystify the Node.js Event Loop. Whether you're a seasoned developer or just starting, this series will provide valuable insights and practical knowledge.&lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>eventloop</category>
    </item>
  </channel>
</rss>
