Ensure RoomService operation is complete prior to returning (#362)

* Ensure service doesn't return before operation is complete

* added integration tests for RoomService
This commit is contained in:
David Zhao
2022-01-21 11:00:33 -08:00
committed by GitHub
parent 126bb8867b
commit f9a1dd97c2
7 changed files with 261 additions and 21 deletions
+10
View File
@@ -556,6 +556,16 @@ func (c *RTCClient) PublishData(data []byte, kind livekit.DataPacket_Kind) error
}
}
func (c *RTCClient) GetPublishedTrackIDs() []string {
c.lock.Lock()
defer c.lock.Unlock()
var trackIDs []string
for key, _ := range c.localTracks {
trackIDs = append(trackIDs, key)
}
return trackIDs
}
func (c *RTCClient) ensurePublisherConnected() error {
if c.publisherConnected.Get() {
return nil