Documentation
¶
Index ¶
- type AgentJob
- type AgentJobRequest
- type AgentService
- type AgentWorker
- func (w *AgentWorker) Close() error
- func (w *AgentWorker) Jobs() []*AgentJob
- func (w *AgentWorker) ReadWorkerMessage() (*livekit.WorkerMessage, int, error)
- func (w *AgentWorker) Register(agentName string, jobType livekit.JobType)
- func (w *AgentWorker) SendAvailability(m *livekit.AvailabilityResponse)
- func (w *AgentWorker) SendMigrateJob(m *livekit.MigrateJobRequest)
- func (w *AgentWorker) SendPing(m *livekit.WorkerPing)
- func (w *AgentWorker) SendRegister(m *livekit.RegisterWorkerRequest)
- func (w *AgentWorker) SendSimulateJob(m *livekit.SimulateJobRequest)
- func (w *AgentWorker) SendUpdateJob(m *livekit.UpdateJobStatus)
- func (w *AgentWorker) SendUpdateWorker(m *livekit.UpdateWorkerStatus)
- func (w *AgentWorker) SetReadDeadline(t time.Time) error
- func (w *AgentWorker) SimulateRoomJob(roomName string)
- func (w *AgentWorker) WriteServerMessage(m *livekit.ServerMessage) (int, error)
- type JobLoad
- func NewNormalRandomJobLoad(mean, stddev float64) JobLoad
- func NewNormalRandomJobLoadWithRNG(mean, stddev float64, rng *rand.Rand) JobLoad
- func NewPeriodicJobLoad(max float32, period time.Duration) JobLoad
- func NewStableJobLoad(load float32) JobLoad
- func NewUniformRandomJobLoad(min, max float32) JobLoad
- func NewUniformRandomJobLoadWithRNG(min, max float32, rng *rand.Rand) JobLoad
- type SimulatedWorkerOption
- func WithContext(ctx context.Context) SimulatedWorkerOption
- func WithDefaultWorkerLoad(load float32) SimulatedWorkerOption
- func WithJobAssignmentHandler(h func(*livekit.Job) JobLoad) SimulatedWorkerOption
- func WithJobAvailabilityHandler(h func(AgentJobRequest)) SimulatedWorkerOption
- func WithJobLoad(l JobLoad) SimulatedWorkerOption
- func WithLabel(label string) SimulatedWorkerOption
- type SimulatedWorkerOptions
- type TestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentJobRequest ¶
type AgentJobRequest struct { *livekit.AvailabilityRequest // contains filtered or unexported fields }
func (AgentJobRequest) Accept ¶
func (r AgentJobRequest) Accept()
func (AgentJobRequest) Reject ¶
func (r AgentJobRequest) Reject()
type AgentService ¶
type AgentService interface { HandleConnection(context.Context, agent.SignalConn, agent.WorkerProtocolVersion) DrainConnections(time.Duration) }
type AgentWorker ¶
type AgentWorker struct { *SimulatedWorkerOptions RegisterWorkerResponses *events.ObserverList[*livekit.RegisterWorkerResponse] AvailabilityRequests *events.ObserverList[*livekit.AvailabilityRequest] JobAssignments *events.ObserverList[*livekit.JobAssignment] JobTerminations *events.ObserverList[*livekit.JobTermination] WorkerPongs *events.ObserverList[*livekit.WorkerPong] // contains filtered or unexported fields }
func (*AgentWorker) Close ¶
func (w *AgentWorker) Close() error
func (*AgentWorker) Jobs ¶
func (w *AgentWorker) Jobs() []*AgentJob
func (*AgentWorker) ReadWorkerMessage ¶
func (w *AgentWorker) ReadWorkerMessage() (*livekit.WorkerMessage, int, error)
func (*AgentWorker) Register ¶
func (w *AgentWorker) Register(agentName string, jobType livekit.JobType)
func (*AgentWorker) SendAvailability ¶
func (w *AgentWorker) SendAvailability(m *livekit.AvailabilityResponse)
func (*AgentWorker) SendMigrateJob ¶
func (w *AgentWorker) SendMigrateJob(m *livekit.MigrateJobRequest)
func (*AgentWorker) SendPing ¶
func (w *AgentWorker) SendPing(m *livekit.WorkerPing)
func (*AgentWorker) SendRegister ¶
func (w *AgentWorker) SendRegister(m *livekit.RegisterWorkerRequest)
func (*AgentWorker) SendSimulateJob ¶
func (w *AgentWorker) SendSimulateJob(m *livekit.SimulateJobRequest)
func (*AgentWorker) SendUpdateJob ¶
func (w *AgentWorker) SendUpdateJob(m *livekit.UpdateJobStatus)
func (*AgentWorker) SendUpdateWorker ¶
func (w *AgentWorker) SendUpdateWorker(m *livekit.UpdateWorkerStatus)
func (*AgentWorker) SetReadDeadline ¶
func (w *AgentWorker) SetReadDeadline(t time.Time) error
func (*AgentWorker) SimulateRoomJob ¶
func (w *AgentWorker) SimulateRoomJob(roomName string)
func (*AgentWorker) WriteServerMessage ¶
func (w *AgentWorker) WriteServerMessage(m *livekit.ServerMessage) (int, error)
type JobLoad ¶
type JobLoad interface {
Load() float32
}
func NewNormalRandomJobLoad ¶
func NewStableJobLoad ¶
func NewUniformRandomJobLoad ¶
type SimulatedWorkerOption ¶
type SimulatedWorkerOption func(*SimulatedWorkerOptions)
func WithContext ¶
func WithContext(ctx context.Context) SimulatedWorkerOption
func WithDefaultWorkerLoad ¶
func WithDefaultWorkerLoad(load float32) SimulatedWorkerOption
func WithJobAssignmentHandler ¶
func WithJobAssignmentHandler(h func(*livekit.Job) JobLoad) SimulatedWorkerOption
func WithJobAvailabilityHandler ¶
func WithJobAvailabilityHandler(h func(AgentJobRequest)) SimulatedWorkerOption
func WithJobLoad ¶
func WithJobLoad(l JobLoad) SimulatedWorkerOption
func WithLabel ¶
func WithLabel(label string) SimulatedWorkerOption
type SimulatedWorkerOptions ¶
type TestServer ¶
type TestServer struct {
AgentService
}
func NewTestServer ¶
func NewTestServer(bus psrpc.MessageBus) *TestServer
func NewTestServerWithService ¶
func NewTestServerWithService(s AgentService) *TestServer
func (*TestServer) Close ¶
func (h *TestServer) Close()
func (*TestServer) SimulateAgentWorker ¶
func (h *TestServer) SimulateAgentWorker(opts ...SimulatedWorkerOption) *AgentWorker
Click to show internal directories.
Click to hide internal directories.