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

Method OnAgentStop

pkg/middleware/stack.go:90–98  ·  view source on GitHub ↗

OnAgentStop 通知所有中间件 Agent 停止

(ctx context.Context, agentID string)

Source from the content-addressed store, hash-verified

88
89// OnAgentStop 通知所有中间件 Agent 停止
90func (s *Stack) OnAgentStop(ctx context.Context, agentID string) error {
91 // 逆序通知(LIFO)
92 for i := len(s.middlewares) - 1; i >= 0; i-- {
93 if err := s.middlewares[i].OnAgentStop(ctx, agentID); err != nil {
94 return err
95 }
96 }
97 return nil
98}
99
100// Middlewares 返回中间件列表
101func (s *Stack) Middlewares() []Middleware {

Callers 3

mainFunction · 0.95
mainFunction · 0.95

Calls 1

OnAgentStopMethod · 0.65

Tested by 1