Chapter 9. Asynchronous data

 

This chapter covers

  • Handling data asynchronously
  • Scheduling asynchronous tasks
  • Streaming HTTP responses
  • Unidirectional communication with Comet
  • Bidirectional communication with WebSockets

In this chapter, we’ll learn how to process data asynchronously and how to schedule asynchronous jobs. First, we’ll get familiar with the principle behind asynchronous data handling and why it’s useful. One of the goals of handling data asynchronously is allowing our application to scale to thousands of concurrent connections, while responding to clients immediately. Then we’ll learn about an older but widely used protocol to handle data asynchronously between servers and clients: Comet. We’ll finish with the WebSocket protocol, which is a standard way to communicate data asynchronously between servers and clients.

This is a long chapter, as we’re going to try to cover most of the aspects of Play 2’s asynchronous feature. But because this is an essential Play 2 feature, it’s worth it.

Before we start, a little introduction to asynchronous data is useful.

9.1. What do we mean by asynchronous data?

 

9.2. Handling asynchronous data

 
 
 

9.3. Scheduling asynchronous tasks

 
 
 
 

9.4. Streaming HTTP responses

 
 

9.5. Unidirectional communication with Comet

 
 
 

9.6. Bidirectional communication with WebSockets

 
 

9.7. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage