Skip to content

Commit 741f00e

Browse files
authored
Adds callback on stream reconnects (#60)
Invoke the callback function if the monitoring loops successfully reconnects the websocket.
1 parent 59666f4 commit 741f00e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

go/stream.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ func (s *stream) monitorConn(conn *wsConn) {
256256
return
257257
}
258258
conn.replace(re.conn)
259+
if s.connStatusCallback != nil {
260+
go s.connStatusCallback(true, conn.host, conn.origin)
261+
}
259262
s.config.logInfo(
260263
"client: stream websocket %s: reconnected",
261264
conn.origin,

0 commit comments

Comments
 (0)