Export CloseSignalConnection (#936)

* Export CloseSignalConnection

There are a few places where that close pattern is repeated.
Export it and use that function in other places directly.

* fix test
This commit is contained in:
Raja Subramanian
2022-08-21 11:33:35 +05:30
committed by GitHub
parent b8bda3f14b
commit 70422c0267
6 changed files with 41 additions and 77 deletions
+3 -3
View File
@@ -612,7 +612,7 @@ func (p *ParticipantImpl) Close(sendLeave bool, reason types.ParticipantCloseRea
p.updateState(livekit.ParticipantInfo_DISCONNECTED)
// ensure this is synchronized
p.closeSignalConnection()
p.CloseSignalConnection()
p.lock.RLock()
onClose := p.onClose
p.lock.RUnlock()
@@ -1206,7 +1206,7 @@ func (p *ParticipantImpl) setupDisconnectTimer() {
func (p *ParticipantImpl) onAnyTransportFailed() {
// clients support resuming of connections when websocket becomes disconnected
p.closeSignalConnection()
p.CloseSignalConnection()
// detect when participant has actually left.
p.setupDisconnectTimer()
@@ -1891,7 +1891,7 @@ func (p *ParticipantImpl) handleSubscriberNegotiationFailed() {
},
},
})
p.closeSignalConnection()
p.CloseSignalConnection()
}
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, f func(sub types.LocalParticipant) error) {