Chapter 6. Using Channels to Implement a Real-time Application
Web applications use the request/response message exchange pattern to communicate with the server. The communication flow always starts from the client (usually a web browser), initiating a request and a server that provides a response and closes the connection immediately after. This means that if we need to get information from a server as soon as they are available, our client has to actively and repeatedly request for them using a polling strategy, which is a simple but often ineffective solution. In fact, if the poll interval is short, we need to perform a lot of requests, which consumes time and bandwidth and overloads the server; on the other hand, if the poll interval is long, we cannot consider the delivery of the information as real time anymore.
Real-time interaction between clients and servers is a requirement for a large set of web applications such as collaborative editors, online multiplayer games, or...