MCPcopy
hub / github.com/yusing/godoxy / Add

Function Add

internal/agentpool/pool.go:40–45  ·  view source on GitHub ↗
(cfg *agent.AgentConfig)

Source from the content-addressed store, hash-verified

38}
39
40func Add(cfg *agent.AgentConfig) (added bool) {
41 _, loaded := agentPool.LoadOrCompute(cfg.Addr, func() (*Agent, bool) {
42 return newAgent(cfg), false
43 })
44 return !loaded
45}
46
47func Has(cfg *agent.AgentConfig) bool {
48 _, ok := agentPool.Load(cfg.Addr)

Callers 2

verifyStartNewAgentFunction · 0.92
loadRouteProvidersMethod · 0.92

Calls 1

newAgentFunction · 0.85

Tested by

no test coverage detected