NodeJS – understanding process.nextTick()

Understanding process.nextTick() – How To Node – NodeJS.

var http =require(‘http’);

function compute(){
   
// performs complicated calculations continuously
   
// …
    process
.nextTick(compute);
}

http
.createServer(function(req, res){
     res
.writeHead(200,{‘Content-Type’:‘text/plain’});
     res
.end(‘Hello World’);
}).listen(5000,‘127.0.0.1’);

compute
();

 

 

 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s