Closed gabe565 closed 1 year ago
Ah I didn't even think of this use-case. I don't think the non-blocking is the way to go either. Happy with this approach :)
Yeah I missed it too until I started testing some connection issues in CastSponsorSkip 😅 Thanks!
Ever since #166,
application.Close()
will panic withclose of closed channel
if closed more than once. This PR wraps the close call withsync.Once.Do()
so that it can only be called once. This will cause the channel close to simply be skipped after the first call.This could also be done with a non-blocking select, but has the downside of skipping the close if one of the channels happens to have data at the time that close is called. Let me know if you prefer this other method: