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

Function AgentActorGetStatus

pkg/agent/actor.go:574–587  ·  view source on GitHub ↗

AgentActorGetStatus 获取 Agent 状态

(pid *actor.PID, timeout time.Duration)

Source from the content-addressed store, hash-verified

572
573// AgentActorGetStatus 获取 Agent 状态
574func AgentActorGetStatus(pid *actor.PID, timeout time.Duration) (*types.AgentStatus, error) {
575 replyCh := make(chan *types.AgentStatus, 1)
576
577 pid.Tell(&GetStatusMsg{
578 ReplyTo: replyCh,
579 })
580
581 select {
582 case status := <-replyCh:
583 return status, nil
584 case <-time.After(timeout):
585 return nil, fmt.Errorf("get status timed out after %v", timeout)
586 }
587}

Callers

nothing calls this directly

Calls 1

TellMethod · 0.80

Tested by

no test coverage detected