Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mashup

While one process is still "running" and printing "world" every 5 seconds, we add a new "process" fetching a website every 2 seconds. It just works.

setInterval(function() {
    console.log("world");
}, 5000);

var http = require('http');
setInterval(function() {
    console.log("fetching google.com");
    http.get({ host: 'google.com' }, function(res) {
        console.log(res.headers);
    });
}, 2000);

console.log("hello");