DailyJS

Node - 21st Century Concurrency

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

concurrency networking server nodejs

Node - 21st Century Concurrency

Posted by Alex R. Young on .
Featured

concurrency networking server nodejs

Node - 21st Century Concurrency

Posted by Alex R. Young on .

Node is event-based IO for V8 JavaScript. It provides an alternative
approach for building non-blocking scalable programs using a model
inspired by EventMachine and
Twisted.

Here's an example taken from nodejs.org:

var sys = require('sys'), 
   http = require('http');

http.createServer(function (req, res) {
  setTimeout(function () {
    res.sendHeader(200, {'Content-Type': 'text/plain'});
    res.sendBody('Hello World');
    res.finish();
  }, 2000);
}).listen(8000);

sys.puts('Server running at http://127.0.0.1:8000/');

Node's features include events, timers, child processes, POSIX, TCP,
modules (from CommonJS) and there's even a REPL for experimenting. For
more information, visit: