Closed dobomode closed 4 months ago
I'm not sure, but I would say this timeout is there to give you enough time to register the event listeners. Imagine an error happens immediately when you try to open the SSE connection but you haven't added your event listeners yet, so you can't handle the error. However, for this purpose a timeout of 50ms or so would probably be enough 🤔
@dobomode When you create an EventSource instance it starts connection. timeoutBeforeConnection
gives time to initialize all event listeners.
Currently
timeoutBeforeConnection
defaults to 500ms and introduces an artificial latency in my app's requests. Is there any specific reason this is the case and why wouldn't we always prefer to set this to 0ms (no latency)?