The Web has changed; HTML5 is almost there and is already implemented by all browsers. At least, the useful parts of it are available, especially the parts we'll use in this section.
It's now very familiar and it won't surprise you anymore, but Play! Framework 2 will again demonstrate that it is a real web framework by integrating things such as WebSocket or its old fallback, Comet .
Actually, Comet is not really a fallback for WebSocket since it's unidirectional while the latter is bidirectional. Nevertheless, there is another specification that does the same as Comet: Server-Sent Events (SSE). Even if an implementation of SSE is not (yet) provided by default, Play! 2's API will help us a lot in implementing it on our own really easily. This tool in hand, our application would have a really good push mechanism in place.
In this chapter, we'll focus on the most popular one, which is WebSocket. Hopefully, this is the one we'll need in our application to make it more responsive...