Open
Description
Was playing around with this lib trying to have a fault tolerant ws connection. Tried patches from different prs and forks, still there was a present problem with race - multiple reconnects occurring from time to time. Also making a custom heartbeat is a headache.
And realised, why not just wrap the ws listener in infinite cycle?
for {
select {
case <-ctx.Done():
return
default:
err := InitAndListenWs()
if err != nil {
....
}
}
}
No concurrency problems and easy to implement.
Metadata
Metadata
Assignees
Labels
No labels
Activity