From the course: Advanced Node.js
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Logging concurrent tasks - Node.js Tutorial
From the course: Advanced Node.js
Logging concurrent tasks
- [Voice Over] In the last video, we created a promise queue. Let's set up a way to visualize this queue in the console. What I wanna do is install an NPM called log update. So I'm gonna come over here to the terminal and type NPM install log update. And what log update is gonna do is it's gonna allow us to keep the updates that we wanna log to the console in the same place. So they will over write each other as opposed to seeing continuous console logs scroll down our terminal. So I'm gonna come up here to line one, and I'm gonna make sure I import that. Log update equals require log update. So we'll use that to manage the console log. And then I'm gonna create another variable called to X. And what to X is gonna do is it's just going to return a capital X. So what we're gonna do is take every item in the queue and we're gonna represent it with a capital X. So I will use that to X function inside of my logs. So I'm gonna go ahead and create one more function inside of my promise…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Callback pattern8m
-
(Locked)
Resolving promises5m 40s
-
(Locked)
Rejecting promises2m 58s
-
(Locked)
The promisify function5m 18s
-
(Locked)
Sequential execution7m 6s
-
(Locked)
Sequential execution with async/await7m
-
(Locked)
Parallel execution4m 6s
-
(Locked)
Concurrent tasks6m 3s
-
(Locked)
Logging concurrent tasks3m 3s
-
-
-
-