Wire pool-level Retire closure; emit EventRetired on terminal dial failure

This commit is contained in:
Jay
2026-06-06 19:50:58 -04:00
parent 7657de160e
commit 35428a4dad
2 changed files with 74 additions and 0 deletions
+9
View File
@@ -348,6 +348,15 @@ func (p *Pool) Connect(id string, opts ...ConnectOption) error {
Inbox: p.inbox,
Events: p.events,
InboxCounter: p.inboxCounter,
Retire: func(err error) {
p.mu.Lock()
defer p.mu.Unlock()
if p.closed {
return
}
delete(p.peers, id)
p.events <- PoolEvent{ID: id, Kind: EventRetired, Err: err, At: time.Now()}
},
}
p.wg.Go(func() {