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

Method OnAgentStart

pkg/middleware/logic_memory.go:158–166  ·  view source on GitHub ↗

OnAgentStart Agent 启动时启动事件处理器

(ctx context.Context, agentID string)

Source from the content-addressed store, hash-verified

156
157// OnAgentStart Agent 启动时启动事件处理器
158func (m *LogicMemoryMiddleware) OnAgentStart(ctx context.Context, agentID string) error {
159 // 启动异步事件处理 goroutine
160 if m.config.AsyncCapture && m.config.EnableCapture && m.eventBuffer != nil {
161 m.wg.Add(1)
162 go m.processEventsAsync()
163 lmLog.Info(context.Background(), "started async event processor", map[string]any{"agent_id": agentID})
164 }
165 return nil
166}
167
168// OnAgentStop Agent 停止时停止事件处理器
169func (m *LogicMemoryMiddleware) OnAgentStop(ctx context.Context, agentID string) error {

Calls 3

processEventsAsyncMethod · 0.95
AddMethod · 0.65
InfoMethod · 0.65

Tested by 1