removed pool errors channels

This commit is contained in:
Jay
2026-05-12 10:59:50 -04:00
parent 56c2539249
commit 89ec7e2ab7
11 changed files with 7 additions and 116 deletions
-11
View File
@@ -29,7 +29,6 @@ type PoolEvent struct {
type PoolStats struct {
ChanInbox int
ChanEvents int
ChanErrors int
TotalReceived uint64
TotalSent uint64
@@ -47,7 +46,6 @@ type PoolPlugin struct {
ID string
Inbox chan<- types.InboxMessage
Events chan<- PoolEvent
Errors chan<- error
InboxCounter *atomic.Uint64
Dialer types.Dialer
ConnectionConfig *transport.ConnectionConfig
@@ -70,7 +68,6 @@ type Pool struct {
peers map[string]*Peer
inbox chan types.InboxMessage
events chan PoolEvent
errors chan error
inboxCounter *atomic.Uint64
outgoingCount *atomic.Uint64
@@ -124,7 +121,6 @@ func NewPool(ctx context.Context, id string, config *PoolConfig, handler slog.Ha
peers: make(map[string]*Peer),
inbox: make(chan types.InboxMessage, config.InboxBufferSize),
events: make(chan PoolEvent, config.EventsBufferSize),
errors: make(chan error, config.ErrorsBufferSize),
inboxCounter: &atomic.Uint64{},
outgoingCount: &atomic.Uint64{},
dialer: transport.NewDialer(),
@@ -153,10 +149,6 @@ func (p *Pool) Events() <-chan PoolEvent {
return p.events
}
func (p *Pool) Errors() <-chan error {
return p.errors
}
func (p *Pool) Stats() PoolStats {
p.mu.RLock()
defer p.mu.RUnlock()
@@ -173,7 +165,6 @@ func (p *Pool) Stats() PoolStats {
return PoolStats{
ChanInbox: len(p.inbox),
ChanEvents: len(p.events),
ChanErrors: len(p.errors),
TotalReceived: p.inboxCounter.Load(),
TotalSent: p.outgoingCount.Load(),
@@ -228,7 +219,6 @@ func (p *Pool) Close() {
p.wg.Wait()
close(p.inbox)
close(p.events)
close(p.errors)
if p.logger != nil {
p.logger.Info("closed")
@@ -273,7 +263,6 @@ func (p *Pool) Connect(id string) error {
ID: p.id,
Inbox: p.inbox,
Events: p.events,
Errors: p.errors,
InboxCounter: p.inboxCounter,
Dialer: p.dialer,
ConnectionConfig: p.config.ConnectionConfig,