Skip to content

Commit

Permalink
Call reconnect handlers in goroutine (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmmarslender authored Mar 17, 2024
1 parent 7e9a1c8 commit 4cd4273
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/websocketclient/websocketclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,9 @@ func (c *WebsocketClient) reconnectLoop() {
}
}
for _, handler := range c.reconnectHandlers {
handler()
// This must be a goroutine in case the handler relies on a blocking request over the websocket
// Without, this blocks the listener from receiving the message and passing it back
go handler()
}
return
}
Expand Down

0 comments on commit 4cd4273

Please sign in to comment.