Added mode to the eventStreamInitDict so that fetch can be disabled in the http request (mode = 'disable-fetch') #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the ability to set the mode in the eventStreamInitDict to pass onto the HTTP Options of the http request. This allows 'disable-fetch' where you need to be able to abort the event stream connection.
In Chrome the http fetch option is used and this results in close() on the EventSource not being able to abort the request. I have multiple event-streams that I start and stop depending on the context in the application, I discovered that close() was leaving the connection open and once I reached the 6 concurrent streams to the same origin all future requests to that origin now got stuck in a queue.
This issue in the stream-http project is outlined here: jhiesey/stream-http#26. This problem flows into the eventsource project.
I wasn't sure of any automated tests that could be created for this, my test procedure was to monitor the connections in the Network tab of the Chrome debugger and see that the stream was closed when close() was called on the EventSource (it was always left open previously).
I also updated the mocha devDependency that came back as outdated to 4.1.0