On Oct 23, 2009, at 4:42 PM, Michael Nordman wrote:
I buy all of those advantages. This feature is a nice formalization of the commonly used "hanging GET" found in many ajax applications.
Indeed, that's basically the point. It provides a reliable and convenient interface to the "hanging GET" pattern.
An area that may be worth exploring, that would add to the list things that go beyond syntactic sugar, could be for multiple documents to listen in on the same event-stream backed by the same connection to the server. This could reduce the total number of hanging GET style connections used by an application (spread across multiple pages / workers) on a particular client, and by extension the number of connections seen by the server-side.
Interesting idea. We could do this purely on the client by giving the EventSource constructor a "shared" flag. But we'd probably have to allow event source sharing only between clients from the same origin. Maybe we can give the server a way to allow sharing the contents of an event stream cross-origin but I would be hesitant to do that and I think the use case is weaker.
Regards, Maciej