Tag Archive for 'ajax'

AJAX Requests for Realtime Messaging

AJAX is ubiquitous these days.  Its incredibly common to see pages update themselves.  Your Twitter homepage, or Facebook timeline will periodically update itself seamlessly integrating the new content into the interface.

Websites with realtime updates often poll for new updates.  They do this because HTTP is a stateless protocol, as soon as your request completes the server can send no more information unless you make another request.  It works, but your stream is not realtime, your content is delayed.  Delay is fine for a news article, but not something interactive like chat or a game.  Interactive applications are negatively affected by latency in message delivery.  Realtime messaging is required for a good experience.

The interactive display outside the Open Source Lab’s server room needed realtime messaging for the display to quickly respond to user input.  It’s powered by Touchscreen 2.0, which ships with a realtime messaging server; a message queue which clients can push and pop via a REST API.  It responds in 100ms providing seamless interaction between two web browsers.  Let’s talk about how it works.

Continue reading ‘AJAX Requests for Realtime Messaging’