r3labs / sse

Server Sent Events server and client for Golang
Mozilla Public License 2.0
857 stars 179 forks source link

Client OnConnect event added #137

Closed enverbisevac closed 1 year ago

enverbisevac commented 2 years ago

OnConnect is callback when request is successful. IMO thisshould part of the client api. if we follow SSE spec then events should be named OnClose and OnOpen.

purehyperbole commented 1 year ago

Hey @enverbisevac , sorry for the extreme delay in getting back to you.

Unfortunately the usage of default here in the select statement causes the loop to spin while there are no values on either of the other channels. This spinning consumes an entire cpu, so I can't merge this as is.

Are you able to come up with a different solution for your feature please?

purehyperbole commented 1 year ago

Thanks for the contribution @enverbisevac !