MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / session

Struct session

internal/nodeagent/session.go:73–86  ·  view source on GitHub ↗

session 是单次 Session 的状态: - inflight:reqID -> cancelFunc,用于响应 cancel_id; - acks:seq -> chan struct{},用于 WaitAck; - sendMu:保护 stream.Send,多 goroutine 串行写。

Source from the content-addressed store, hash-verified

71// - acks:seq -> chan struct{},用于 WaitAck;
72// - sendMu:保护 stream.Send,多 goroutine 串行写。
73type session struct {
74 ctx context.Context
75 cancel context.CancelFunc
76 cfg Config
77 stream nodev1.NodeAgent_SessionClient
78
79 sendMu sync.Mutex
80
81 mu sync.Mutex
82 inflight map[string]context.CancelFunc
83 acks map[uint64]chan struct{}
84
85 wg sync.WaitGroup
86}
87
88func newSession(ctx context.Context, cancel context.CancelFunc, cfg Config, stream nodev1.NodeAgent_SessionClient) *session {
89 return &session{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected