Node's goal is to provide an easy way to build scalable network programs. In the above example, the two second delay does not prevent the server from handling new requests.
Node tells the operating system (through epoll, kqueue, /dev/poll, or select) that it should be notified when the 2 seconds are up or if a new connection is made—then it goes to sleep.
If someone new connects, then it executes the callback, if the timeout expires, it executes the inner callback.
Every connection stream is only a small allocation heap.
What's New in This Release: [ read full changelog ]
· Skip GetFileAttributes call when opening a file.
· Added PKCS12/PFX support.
· Delete NODE_CHANNEL_FD from env in spawn.
· Added test for path.normalize with UNC paths.
· Make path.normalize convert all slashes to backslashes.
· Automatically close FSWatcher on error.
· fs.ReadStream.pause() emits duplicate data event.
· Don't assert() on pipe accept errors.
· Better exception output for module load and process.nextTick.
· Fixed error reporting.
· Don't destroy on timeout.
· Don't try to emit error on a null'ed req object.
· Refactor ClientRequest.onSocket.