
This demo showcases the optional comet-style behavior of the query() operation, allowing for asynchronous server-push functionality in DovetailDB applications.
The constraints on the chat message query are set to return results newer than the last one displayed. To wait for new messages, we simply add a comet_timeout option with a value of 30 (seconds) to the query call, at which point it will wait up to 30 seconds for new messages to arrive (and return immediately when one does arrive). Feel free to "view source" on this page to understand more about how it's done.