add idempotent reference count to telemetry stats worker (#3964)
* add idempotent reference guard to telemetry stats worker * tidy * sync * tidy
This commit is contained in:
@@ -283,6 +283,9 @@ type ParticipantImpl struct {
|
||||
rttUpdatedAt time.Time
|
||||
lastRTT uint32
|
||||
|
||||
// idempotent reference guard for telemetry stats worker
|
||||
telemetryGuard *telemetry.ReferenceGuard
|
||||
|
||||
lock utils.RWMutex
|
||||
|
||||
dirty atomic.Bool
|
||||
@@ -369,6 +372,7 @@ func NewParticipant(params ParticipantParams) (*ParticipantImpl, error) {
|
||||
rpcPendingAcks: make(map[string]*utils.DataChannelRpcPendingAckHandler),
|
||||
rpcPendingResponses: make(map[string]*utils.DataChannelRpcPendingResponseHandler),
|
||||
onClose: make(map[string]func(types.LocalParticipant)),
|
||||
telemetryGuard: &telemetry.ReferenceGuard{},
|
||||
}
|
||||
p.setupSignalling()
|
||||
|
||||
@@ -884,6 +888,10 @@ func (p *ParticipantImpl) ToProto() *livekit.ParticipantInfo {
|
||||
return pi
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) TelemetryGuard() *telemetry.ReferenceGuard {
|
||||
return p.telemetryGuard
|
||||
}
|
||||
|
||||
// callbacks for clients
|
||||
|
||||
func (p *ParticipantImpl) OnTrackPublished(callback func(types.LocalParticipant, types.MediaTrack)) {
|
||||
|
||||
Reference in New Issue
Block a user