3 ms·
How 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'
by tome 8y ago
How 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.