Remove ops queue from stream tracker.
It is not needed as the callback happens in a goroutine.
Also, had missed included bitrate availability change in the queue
which was inconsistent.
@@ -6,7 +6,6 @@ import (
"go.uber.org/atomic"
- "github.com/livekit/livekit-server/pkg/utils"
"github.com/livekit/protocol/logger"
)
@@ -72,8 +71,6 @@ type StreamTracker struct {
bytesForBitrate [4]int64
bitrate [4]int64
- callbacksQueue *utils.OpsQueue
-
isStopped bool
}
@@ -81,7 +78,6 @@ func NewStreamTracker(params StreamTrackerParams) *StreamTracker {
s := &StreamTracker{
params: params,
status: StreamStatusStopped,
- callbacksQueue: utils.NewOpsQueue(params.Logger, "streamtracker", 50),
}
return s
}
@@ -113,9 +109,7 @@ func (s *StreamTracker) maybeSetStatus(status StreamStatus) (StreamStatus, bool)
func (s *StreamTracker) maybeNotifyStatus(status StreamStatus, changed bool) {
if changed && s.onStatusChanged != nil {
- s.callbacksQueue.Enqueue(func() {
s.onStatusChanged(status)
- })
}
}
@@ -130,7 +124,6 @@ func (s *StreamTracker) init() {
}
func (s *StreamTracker) Start() {
- s.callbacksQueue.Start()
}
func (s *StreamTracker) Stop() {
@@ -142,8 +135,6 @@ func (s *StreamTracker) Stop() {
}
s.isStopped = true
- s.callbacksQueue.Stop()
-
// bump generation to trigger exit of worker
s.generation.Inc()
}
