igorw / EventSource

A PHP 5.3 library for creating an EventSource stream.
MIT License
105 stars 8 forks source link

Controlling the reconnection-timeout #2

Closed willdurand closed 12 years ago

willdurand commented 12 years ago

Hi,

What about adding a support for the retry: line to define the timeout value ? See http://www.html5rocks.com/en/tutorials/eventsource/basics/#toc-reconnection-timeout

That way we could avoid the infinite loop + sleep() :)

William

igorw commented 12 years ago

I have added support to specify it. But I would like to note that this is absolutely not recommended. The whole point of EventSource is that you can maintain a persistent connection and reduce latency. If you don't take advantage of that, you might as well be using AJAX polling. ;-)

EDIT: Note that you don't have to use while+sleep, there are other use cases / methods.

willdurand commented 12 years ago

That makes sense indeed. But, I didnt it was not recommended at all :/

Le 3 janv. 2012 à 00:17, Igor Wiedlerreply@reply.github.com a écrit :

I have added support to specify it. But I would like to note that this is absolutely not recommended. The whole point of EventSource is that you can maintain a persistent connection and reduce latency. If you don't take advantage of that, you might as well be using AJAX polling. ;-)


Reply to this email directly or view it on GitHub: https://github.com/igorw/EventSource/issues/2#issuecomment-3334768