3 ms·
Comet is really an underrated technology. Because, it's not a separate technology. It's worked in browsers for years, and is compatible with any HTTP server to
by paulddraper 8y ago
Comet is really an underrated technology.
Because, it's not a separate technology. It's worked in browsers for years, and is compatible with any HTTP server toolkit/framework that lets you stream a response (so basically all of them).
That said....who would use Comet for long polling? You'd use Comet to avoid the difficulties of long polling.
- tome 8y agoHow is Comet different from long polling? It's not clear to me. The article only mentions COMET in the context of a Python server, and the Wikipedia page isn't much help https://en.wikipedia.org/wiki/Comet_(programming) https://en.wikipedia.org/wiki/Comet_(programming)
- paulddraper 8y agoIt appears my usage is a little different than wikipedia. Apparently "Comet" can mean multiple things. I meant "streaming Comet", which is in my experience what most people mean. Long polling: (1) Request (2) Wait (3) Receive an event. (4) Go back to #1. Streaming Comet: (1) Request (2) Wait (3) Receive an event (4) Go back to #2. Rather than getting a raw response from the server in a request, streaming Comet loads the response in a iframe. The response is streaming HTML and has a series of <script> tags that post events to the parent window. It's arguably easier to manage and scale (no missed events, no need to find the same server again), though it certainly looks a little odd.