refactor: сhanged the connection manager to implement the stream

This commit is contained in:
2026-05-21 22:17:16 +03:00
parent 6077e4c37d
commit b157d7c32d
6 changed files with 86 additions and 86 deletions
@@ -12,7 +12,6 @@ import (
type streamMock struct {
recvCh chan *pb.AgentEvent
sendCh chan *pb.ServerCommandRequest
closeCh chan struct{}
ctx context.Context
mu sync.Mutex
sendErr error
@@ -53,15 +52,10 @@ func (f *streamMock) Recv() (*pb.AgentEvent, error) {
}
}
func (f *streamMock) Close() error {
select {
case f.closeCh <- struct{}{}:
default:
}
func (f *streamMock) CloseRecv() {
f.closeOnce.Do(func() {
close(f.recvCh)
})
return nil
}
type heartBeatMock struct {