MCPcopy
hub / github.com/livekit/livekit / ParticipantResumed

Method ParticipantResumed

pkg/telemetry/events.go:146–182  ·  view source on GitHub ↗
(
	ctx context.Context,
	room *livekit.Room,
	participant *livekit.ParticipantInfo,
	nodeID livekit.NodeID,
	reason livekit.ReconnectReason,
)

Source from the content-addressed store, hash-verified

144}
145
146func (t *telemetryService) ParticipantResumed(
147 ctx context.Context,
148 room *livekit.Room,
149 participant *livekit.ParticipantInfo,
150 nodeID livekit.NodeID,
151 reason livekit.ReconnectReason,
152) {
153 t.enqueue(func() {
154 // create a worker if needed.
155 //
156 // Signalling channel stats collector and media channel stats collector could both call
157 // ParticipantJoined and ParticipantLeft.
158 //
159 // On a resume, the signalling channel collector would call `ParticipantLeft` which would close
160 // the corresponding participant's stats worker.
161 //
162 // So, on a successful resume, create the worker if needed.
163 _, found := t.getOrCreateWorker(
164 ctx,
165 livekit.RoomID(room.Sid),
166 livekit.RoomName(room.Name),
167 livekit.ParticipantID(participant.Sid),
168 livekit.ParticipantIdentity(participant.Identity),
169 nil,
170 )
171 if !found {
172 prometheus.AddParticipant()
173 }
174
175 ev := newParticipantEvent(livekit.AnalyticsEventType_PARTICIPANT_RESUMED, room, participant)
176 ev.ClientMeta = &livekit.AnalyticsClientMeta{
177 Node: string(nodeID),
178 ReconnectReason: reason,
179 }
180 t.SendEvent(ctx, ev)
181 })
182}
183
184func (t *telemetryService) ParticipantLeft(ctx context.Context,
185 room *livekit.Room,

Callers

nothing calls this directly

Calls 6

enqueueMethod · 0.95
getOrCreateWorkerMethod · 0.95
AddParticipantFunction · 0.92
newParticipantEventFunction · 0.85
SendEventMethod · 0.65
ParticipantIDMethod · 0.45

Tested by

no test coverage detected