Partial support for agent dispatch management (#2872)

- Store agent dispaches independently of room agents on rtc.Room
- Serialize agent dispatches in rtc.Room
- Support for agent dispatch and job serialization in redis

The agent Job object references denormalized Room and ParticipantInfo object. When storing Jobs, this sets the Room to nil, and only stores the Participant identity field. When read back, these fields need to be set to their current value.
This commit is contained in:
Benjamin Pracht
2024-07-18 13:36:43 -07:00
committed by GitHub
parent 95f4b304ef
commit a877ba2352
17 changed files with 887 additions and 81 deletions
+4 -1
View File
@@ -211,8 +211,11 @@ func (w *Worker) AssignJob(ctx context.Context, job *livekit.Job) error {
w.mu.Unlock()
}()
now := time.Now()
if job.State == nil {
job.State = &livekit.JobState{}
job.State = &livekit.JobState{
UpdatedAt: now.UnixNano(),
}
}
w.sendRequest(&livekit.ServerMessage{Message: &livekit.ServerMessage_Availability{