Skip to content

Commit cbd1f14

Browse files
mranneyry
authored andcommitted
Remove setTimeout from initial example and description.
1 parent fe89cab commit cbd1f14

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

doc/index.html

+14-14
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@
4545
var sys = require('sys'),
4646
http = require('http');
4747
http.createServer(function (req, res) {
48-
setTimeout(function () {
49-
res.writeHead(200, {'Content-Type': 'text/plain'});
50-
res.end('Hello World\n');
51-
}, 2000);
48+
res.writeHead(200, {'Content-Type': 'text/plain'});
49+
res.end('Hello World\n');
5250
}).listen(8124, "127.0.0.1");
5351
sys.puts('Server running at http://127.0.0.1:8124/');
5452
</pre>
@@ -129,15 +127,13 @@ <h2 id="about">About</h2>
129127

130128
<p>
131129
Node's goal is to provide an easy way to build scalable network
132-
programs. In the above example, the two second delay does not
133-
prevent the server from handling new requests. Node tells the
130+
programs. In the "hello world" web server example above, many
131+
client connections can be handled concurrently. Node tells the
134132
operating system (through <code>epoll</code>, <code>kqueue</code>,
135133
<code class="sh_none">/dev/poll</code>, or <code>select</code>)
136-
that it should be notified when the 2 seconds are up or if a new
137-
connection is made&mdash;then it goes to sleep. If someone new
138-
connects, then it executes the callback, if the timeout expires,
139-
it executes the inner callback. Each connection is only a small
140-
heap allocation.
134+
that it should be notified when a new connection is made, and
135+
then it goes to sleep. If someone new connects, then it executes
136+
the callback. Each connection is only a small heap allocation.
141137
</p>
142138

143139
<p>
@@ -196,12 +192,16 @@ <h2 id="about">About</h2>
196192
passing. In future versions, Node will be able to fork new
197193
processes (using the <a
198194
href="http://www.whatwg.org/specs/web-workers/current-work/"> Web
199-
Workers API </a>), but this is something that fits well into the
200-
current design.
195+
Workers API </a>) which fits well into the current design.
201196
</p>
202197

203198
<p>
204-
See also: <a href="http://s3.amazonaws.com/four.livejournal/20091117/jsconf.pdf">slides</a> from jsconf.
199+
See also:
200+
<ul>
201+
<li><a href="http://s3.amazonaws.com/four.livejournal/20091117/jsconf.pdf">slides</a> from JSConf 2009</li>
202+
<li><a href="http://nodejs.org/jsconf2010.pdf">slides</a> from JSConf 2010</li>
203+
<li><a href="http://www.yuiblog.com/blog/2010/05/20/video-dahl/">video</a> from a talk at Yahoo in May 2010</li>
204+
</ul>
205205
</p>
206206

207207

0 commit comments

Comments
 (0)