O'Reilly logo

RESTful Java Patterns and Best Practices by Bhakti Mehta

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

Polling

Polling is the most traditional way to get data from a data source that produces the stream of events and updates. The client makes requests periodically, and the server sends data if there is a response. In case there is no data to be sent by the server, an empty response is returned. The following diagram shows how continuous polling works:

Polling

Polling comes with multiple drawbacks such as empty responses for requests made when there is no update on the server; this results in waste of bandwidth and processing time. Polling with lower frequencies will result in the client missing the updates close to the time the updates happen, and polling ...

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