HTML and CSS Reference
In-Depth Information
14.7 Summary
In this chapter we have gotten to know Node.js, asynchronous I/O for V8 JavaScript,
and we have practiced JavaScript TDD outside the browser to see how the expe-
rience from previous exercises fares in a completely different environment than
we're used to. By building a small web server to power a chat application we have
gotten to know Node's HTTP, Assert, and Event APIs in addition to the third party
node-promise library.
To provide the application with data, we also built an I/O interface that first
mimicked Node's conventional use of callbacks and later went through a detailed
refactoring exercise to convert it to use promises. Promises offer an elegant way
of working with asynchronous interfaces, and makes concurrency a lot easier, even
when we need to work with results in a predictable order. Promises are usable in any
JavaScript setting, and the Ajax tools seems particularly fit for this style of interface.
In the next chapter we will use the tools built in Chapter 12, Abstracting Browser
Differences: Ajax, and Chapter 13, Streaming Data with Ajax and Comet, to build
a client for the Node backend, resulting in a completely usable in-browser instant
chat application.
 
 
Search WWH ::




Custom Search