Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing COMET clientside

I have read up about what COMET streaming is, and all the various hacks required to get it working across the major browsers. The problems encountered seem to be two fold: 1. Server being able to support many persistent connections 2. Implementing the JS functionality

I have an application where I need to perform COMET streaming. I have already tackled the first problem above - I have a custom server running which delivers updates as it arrives in chunks. I want to now be able to connect using JS to this URL, so I can receive the updates.

Is there a simple COMET library I can use for this? I saw the Orbited project. Can I use the client side JS of orbited to perform this? What kind of modifications do I need to perform in the backend for this?

like image 677
jeffreyveon Avatar asked Jul 05 '09 09:07

jeffreyveon


People also ask

What is the benefit of enabling and using Comet?

Comet is a programming technique that allows a web server to send updates to clients without requiring the clients to explicitly request them. This kind of programming technique is called server push, which means that the server pushes data to the client.

What is Comet application?

Comet is a web application model in which a long-held HTTPS request allows a web server to push data to a browser, without the browser explicitly requesting it. Comet is an umbrella term, encompassing multiple techniques for achieving this interaction.

What is Comet protocol?

The Universal Messaging Comet HTTPS (SSL-encrypted HTTP) Protocol is a lightweight web-based protocol, optimized for communication over web infrastructure such as client or server-side firewalls and proxy servers.

What is Comet api?

API Reference Comet enables data scientists and teams to track, compare, explain and optimize experiments and models across the model's entire lifecycle. From training to production. With just two lines of code. Read Docs For Python SDK.


1 Answers

If you can get your server code to conform to the Bayeux specification then you can use any of the existing cometd javascript implementations, current available in DOJO and jQuery. Unfortunately, the spec is quite complex, especially if you want to do both long-polling and callback-polling. You may be better of just running an existing cometd server like Jetty and then writing a client library for your server code to push data to it.

like image 168
bertrandom Avatar answered Sep 24 '22 16:09

bertrandom