move router room manager link (#103)
This commit is contained in:
@@ -45,7 +45,7 @@ func NewLocalRoomManager(rp RoomStore, router routing.Router, currentNode routin
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &LocalRoomManager{
|
r := &LocalRoomManager{
|
||||||
RoomStore: rp,
|
RoomStore: rp,
|
||||||
lock: sync.RWMutex{},
|
lock: sync.RWMutex{},
|
||||||
rtcConfig: rtcConf,
|
rtcConfig: rtcConf,
|
||||||
@@ -56,7 +56,12 @@ func NewLocalRoomManager(rp RoomStore, router routing.Router, currentNode routin
|
|||||||
currentNode: currentNode,
|
currentNode: currentNode,
|
||||||
webhookPool: workerpool.New(1),
|
webhookPool: workerpool.New(1),
|
||||||
rooms: make(map[string]*rtc.Room),
|
rooms: make(map[string]*rtc.Room),
|
||||||
}, nil
|
}
|
||||||
|
|
||||||
|
// hook up to router
|
||||||
|
router.OnNewParticipantRTC(r.StartSession)
|
||||||
|
router.OnRTCMessage(r.handleRTCMessage)
|
||||||
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateRoom creates a new room from a request and allocates it to a node to handle
|
// CreateRoom creates a new room from a request and allocates it to a node to handle
|
||||||
|
|||||||
@@ -93,10 +93,6 @@ func NewLivekitServer(conf *config.Config,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hook up router to the RoomManager
|
|
||||||
router.OnNewParticipantRTC(roomManager.StartSession)
|
|
||||||
router.OnRTCMessage(roomManager.handleRTCMessage)
|
|
||||||
|
|
||||||
// clean up old rooms on startup
|
// clean up old rooms on startup
|
||||||
if err = roomManager.CleanupRooms(); err != nil {
|
if err = roomManager.CleanupRooms(); err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user