Create response channel before sending StartSession (#1208)

This commit is contained in:
Raja Subramanian
2022-12-05 00:11:52 +05:30
committed by GitHub
parent 12ae179be2
commit 2cad63fe9a
+4 -2
View File
@@ -155,6 +155,10 @@ func (r *RedisRouter) StartParticipantSignal(ctx context.Context, roomName livek
return
}
// index by connectionID, since there may be multiple connections for the participant
// set up response channel before sending StartSession and be ready to receive responses.
resChan := r.getOrCreateMessageChannel(r.responseChannels, string(connectionID))
sink := NewRTCNodeSink(r.rc, livekit.NodeID(rtcNode.Id), pKey)
// serialize claims
@@ -169,8 +173,6 @@ func (r *RedisRouter) StartParticipantSignal(ctx context.Context, roomName livek
return
}
// index by connectionID, since there may be multiple connections for the participant
resChan := r.getOrCreateMessageChannel(r.responseChannels, string(connectionID))
return connectionID, sink, resChan, nil
}