eventsource icon indicating copy to clipboard operation
eventsource copied to clipboard

a thread safe close method

Open iandyh opened this issue 7 years ago • 4 comments

Currently, there are several issues with the library.

  1. Close is not thread safe. the isStreamClosed cannot protect a gorouting sending to a panic panel. ref: #33

  2. Socket leaks. If the server responds with a 404, the resp.Body.Close is not called.

The changes should not affect any existing users.

iandyh avatar Mar 23 '18 06:03 iandyh

ping @donovanhide

iandyh avatar Apr 02 '18 06:04 iandyh

@donovanhide Please have a look at the PR.

iandyh avatar Apr 12 '18 03:04 iandyh

This is too big a change to accept without added unit tests that prove current behaviour is not subtly altered.

donovanhide avatar Apr 12 '18 09:04 donovanhide

It only changes the implementation of all the APIs not the API itself. So the existing test cases are exactly for that.

Sent from my iPhone

On Apr 12, 2018, at 18:34, Donovan Hide [email protected] wrote:

This is too big a change to accept without added unit tests that prove current behaviour is not subtly altered.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

iandyh avatar Apr 12 '18 14:04 iandyh