MCPcopy Create free account
hub / github.com/astercloud/aster / NewPool

Function NewPool

pkg/core/pool.go:29–40  ·  view source on GitHub ↗

NewPool 创建 Agent 池

(opts *PoolOptions)

Source from the content-addressed store, hash-verified

27
28// NewPool 创建 Agent 池
29func NewPool(opts *PoolOptions) *Pool {
30 maxAgents := opts.MaxAgents
31 if maxAgents == 0 {
32 maxAgents = 50
33 }
34
35 return &Pool{
36 agents: make(map[string]*agent.Agent),
37 deps: opts.Dependencies,
38 maxAgents: maxAgents,
39 }
40}
41
42// Create 创建新 Agent 并加入池
43func (p *Pool) Create(ctx context.Context, config *types.AgentConfig) (*agent.Agent, error) {

Callers 15

TestNewFunction · 0.92
TestNewValidationFunction · 0.92
TestRegisterAgentFunction · 0.92
TestRegisterRoomFunction · 0.92
TestRegisterWorkflowFunction · 0.92
TestAddInterfaceFunction · 0.92
TestLifecycleFunction · 0.92
TestGettersFunction · 0.92
TestOptionsValidationFunction · 0.92
registerRoomRoutesMethod · 0.92
NewPoolHandlerFunction · 0.92
mainFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestNewFunction · 0.74
TestNewValidationFunction · 0.74
TestRegisterAgentFunction · 0.74
TestRegisterRoomFunction · 0.74
TestRegisterWorkflowFunction · 0.74
TestAddInterfaceFunction · 0.74
TestLifecycleFunction · 0.74
TestGettersFunction · 0.74
TestOptionsValidationFunction · 0.74
TestRoom_JoinAndLeaveFunction · 0.68
TestRoom_JoinDuplicateFunction · 0.68