cwc / eventsource_ex

Elixir EventSource (Server-Sent Events) client
20 stars 16 forks source link

Fix termination error #19

Closed neilberkman closed 1 year ago

neilberkman commented 1 year ago

I believe this should be handled as a normal termination. Prior to this change I was seeing:

12:13:13.536 [error] GenServer #PID<0.246.0> terminating
** (stop) :connection_terminated
Last message: %HTTPoison.AsyncEnd{id: #Reference<0.613309643.2773745665.193755>}
cwc commented 1 year ago

Ah, interesting. I was still pretty new to Elixir when I wrote that. I think my code at the time may have been monitoring the process and handling things differently in the event it terminated with this specific reason. :thinking: Reading the docs, it would seem that the only difference in behavior compared to using normal is that ugly error log.

So I think it's good to merge, but should probably be a major version bump, as it does change the output of the GenServer when the connection drops. Thoughts?

neilberkman commented 1 year ago

So I think it's good to merge, but should probably be a major version bump, as it does change the output of the GenServer when the connection drops. Thoughts?

Makes sense to me 👍

cwc commented 1 year ago

Sweet, I'll push a new version. I squashed this PR so watch out for that in your local repo. :+1:

neilberkman commented 1 year ago

@cwc thanks for merging! FYI I updated my code here to use the 2.0 version rather than my fork.