diff --git a/node.html b/node.html index 5cf2a8566b..a06fbe9380 100644 --- a/node.html +++ b/node.html @@ -30,7 +30,7 @@ } #toc a { color: #777; } - h1, h2, h3 { color: #9a2; } + h1, h2, h3 { color: inherit; } h1 { margin: 2em 0; @@ -39,6 +39,7 @@ line-height: 44px; font-weight: bold; } + h1 a { color: inherit; } h2 { margin: 2em 0; @@ -87,11 +88,11 @@

Node

Node is a purely evented I/O framework for V8 javascript. Its goal is to enable easy development of - highly concurrent, small footprint programs. For example, this is a + href="#">V8 javascript. It enables easy development of + highly concurrent, efficent network programs. For example, this is a simple web server which responds with "Hello World" after waiting two seconds: -

+
 node.http.server(function (msg) {
   setTimeout(function () {
     msg.sendHeader(200, [["Content-Type", "text/plain"]]);
@@ -102,11 +103,10 @@ node.http.server(function (msg) {
 

While one request is waiting the server will continue to accept and - serve other requests. This is accomplished without threads and is quite - efficient: handling hundreds of concurrent requests while using - little CPU or memory—see benchmarks. - The example might seem esoteric but similar behavior - is required to implement, for example, "comet" servers. + serve other requests. This little server can handle hundreds of + concurrent requests while using little CPU or memory—see benchmarks. The example demonstrates + efficency that is needed for handling long held "comet" requests.

Node is free to download, use, and build upon.

@@ -123,6 +123,8 @@ node.http.server(function (msg) {
  • Evented programs are more efficient
    1. pthread stack size + 2mb default stack size on linux (1mb on windows, 64kb on FreeBSD) + of course this is adjustable
    2. context switching benchmark
    3. Apache vs. Nginx
    4. event machine vs mongrel (neverblock) @@ -174,7 +176,7 @@ node.http.server(function (msg) { the thread scheduler, a blocking server can make function calls which preform full network requests. -
      var response = db.execute("SELECT * FROM table");
      +    
      var response = db.execute("SELECT * FROM table");
       // do something

      An evented server manages its concurrency itself. All connections @@ -184,7 +186,7 @@ node.http.server(function (msg) { blocks the process. In the evented world callbacks are used instead of functions -

      db.execute("SELECT * FROM table", function (response) {
      +
      db.execute("SELECT * FROM table", function (response) {
         // do something
       });