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

Get Play for Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.