O'Reilly logo

Play for Java by Nicolas Leroux and Sietse de Kaper

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required