gempir / go-twitch-irc

go irc client for twitch.tv
MIT License
358 stars 59 forks source link

Stop client.Connect() loop #181

Closed windmeup closed 2 years ago

windmeup commented 2 years ago

When client.Disconnect() throw ErrConnectionIsNotOpen, there is no other way to break client.Connect() loop. Add a method to do this mybe convenient.

pajlada commented 2 years ago

Ah yeah, I can see that locking you into that connection loop.

I think this could be solved by making the client Context aware in the library and handling manual disconnects through that.

windmeup commented 2 years ago

For now, if want to disconnect, have to wait the connection active. Consider the reconnect loop exists, it's little more complicated. I think add something like dispose, may be convenient when some one want to shutdown the chatbot application at any time.