rework multi-node routing, cleaner design for reconnection

This commit is contained in:
David Zhao
2021-01-30 22:24:08 -08:00
parent 28e73bd109
commit 2cf2c448be
23 changed files with 702 additions and 661 deletions
+2 -5
View File
@@ -23,7 +23,7 @@ type MessageSource interface {
ReadChan() <-chan proto.Message
}
type ParticipantCallback func(roomId, participantId, participantName string, requestSource MessageSource, responseSink MessageSink)
type ParticipantCallback func(roomName, identity string, requestSource MessageSource, responseSink MessageSink)
// Router allows multiple nodes to coordinate the participant session
//counterfeiter:generate . Router
@@ -36,11 +36,8 @@ type Router interface {
GetNode(nodeId string) (*livekit.Node, error)
ListNodes() ([]*livekit.Node, error)
// functions for websocket handler
GetRequestSink(participantId string) (MessageSink, error)
GetResponseSource(participantId string) (MessageSource, error)
// participant signal connection is ready to start
StartParticipantSignal(roomName, participantId, participantName string) error
StartParticipantSignal(roomName, identity string) (reqSink MessageSink, resSource MessageSource, err error)
// when a new participant's RTC connection is ready to start
OnNewParticipantRTC(callback ParticipantCallback)