Yaffle / EventSource

a polyfill for http://www.w3.org/TR/eventsource/
MIT License
2.11k stars 336 forks source link

EventSourcePolyfill - How to limit the retires if the call failed #153

Closed ariel262626 closed 4 years ago

ariel262626 commented 4 years ago

Hi, If i set eventListener to eventSource (EventSourcePolyfill object) and the call is failed (server is down, ...) the API call retries unlimited times to make the call.

Thanks.

Yaffle commented 4 years ago

@ariel262626 , the native implementation tells, that "retry: \n" can be used in the event stream, just set it to some big number

ariel262626 commented 4 years ago

Thanks, where can i find that configuration setting?

Yaffle commented 4 years ago

@ariel262626 , https://javascript.info/server-sent-events#reconnection