We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73e3309 commit 59122e3Copy full SHA for 59122e3
notify.go
@@ -22,19 +22,21 @@ func (p *PubSubNotif) Connected(n network.Network, c network.Conn) {
22
return
23
}
24
25
- select {
26
- case <-p.newPeersSema:
27
- case <-p.ctx.Done():
28
- return
29
- }
+ go func() {
+ select {
+ case <-p.newPeersSema:
+ case <-p.ctx.Done():
+ return
30
+ }
31
- p.newPeersPend[c.RemotePeer()] = struct{}{}
32
- p.newPeersSema <- struct{}{}
+ p.newPeersPend[c.RemotePeer()] = struct{}{}
33
+ p.newPeersSema <- struct{}{}
34
35
- case p.newPeers <- struct{}{}:
36
- default:
37
+ case p.newPeers <- struct{}{}:
+ default:
38
39
+ }()
40
41
42
func (p *PubSubNotif) Disconnected(n network.Network, c network.Conn) {
0 commit comments