package agent import ( llmgwv1 "gitea.mynodes.xyz/ilker/llmgw/api/gen/llmgw/v1" ) // FeatureSlurm is the agent keeping its node's part in Slurm (BACKLOG P). const FeatureSlurm = "slurm" // slurmMarker says llmgw started Slurm's daemons on this machine. var slurmMarker = "/var/lib/llmgw-agent/slurm" // setSlurmOut is where Slurm's status goes now: this session's queue, or // nowhere between sessions. func (a *Agent) setSlurmOut(out chan<- *llmgwv1.AgentMessage) { a.mu.Lock() a.slurmOut = out a.mu.Unlock() if out != nil { a.slurm.Resend() } } // sendSlurm queues a status without waiting: a full queue or no session // drops it, and the next session is sent it again. func (a *Agent) sendSlurm(st *llmgwv1.SlurmStatus) { a.mu.Lock() out := a.slurmOut a.mu.Unlock() if out == nil { return } select { case out <- &llmgwv1.AgentMessage{Msg: &llmgwv1.AgentMessage_SlurmStatus{SlurmStatus: st}}: default: a.log.Warn("Slurm's status not sent: the queue to the control plane is full") } }