1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

Node API allows us to drop all network locks

Network locks are now needed only when accessing client map. node map
access is serialied with the node mutex.
This commit is contained in:
Milos Gajdos
2019-09-13 03:02:20 +01:00
parent ef91d836eb
commit b91c3147e7
4 changed files with 171 additions and 143 deletions

View File

@ -22,11 +22,8 @@ func (n *Network) ListPeers(ctx context.Context, req *pbNet.PeerRequest, resp *p
depth = network.MaxDepth
}
// get node peers
nodePeers := n.Network.Peers()
// get peers encoded into protobuf
peers := network.PeersToProto(n.Network, nodePeers, depth)
peers := network.PeersToProto(n.Network, depth)
resp.Peers = peers