ollie/cmd/olliesrv/internal/agent/subagent.go

17 lines
581 B
Go

package agent
// Depth returns the sub-agent depth (0=top-level).
func (ag *Agent) Depth() int { return ag.depth }
// SetDepth sets the sub-agent depth.
func (ag *Agent) SetDepth(d int) { ag.depth = d }
// IncChildren increments the active child count.
func (ag *Agent) IncChildren() { ag.activeChildren.Add(1) }
// DecChildren decrements the active child count.
func (ag *Agent) DecChildren() { ag.activeChildren.Add(-1) }
// ActiveChildren returns the number of currently-running child sub-agents.
func (ag *Agent) ActiveChildren() int32 { return ag.activeChildren.Load() }