public void Accept(PeerCollector peerCollector, BindingKey routingKey) { if (IsLeaf(routingKey) || _matchesAll) { peerCollector.Offer(_peers); return; } _sharpNode?.Accept(peerCollector, routingKey); _starNode?.Accept(peerCollector, routingKey); var nextPart = routingKey.GetPart(_nextPartIndex); if (nextPart == null) { return; } if (_childrenNodes == null) { return; } SubscriptionNode childNode; if (_childrenNodes.TryGetValue(nextPart, out childNode)) { childNode.Accept(peerCollector, routingKey); } }
public void AddAllPeers(PeerCollector peerCollector) { peerCollector.Offer(_peers); _sharpNode?.AddAllPeers(peerCollector); _starNode?.AddAllPeers(peerCollector); if (_childNodes == null) { return; } foreach (var(_, childNode) in _childNodes) { childNode.AddAllPeers(peerCollector); } }
public void Accept(PeerCollector peerCollector, BindingKey routingKey) { if (IsLeaf(routingKey)) { peerCollector.Offer(_peers); return; } _sharpNode?.AddAllPeers(peerCollector); _starNode?.Accept(peerCollector, routingKey); var nextPart = routingKey.GetPart(_nextPartIndex); if (nextPart == null || _childNodes == null) { return; } if (_childNodes.TryGetValue(nextPart, out var childNode)) { childNode.Accept(peerCollector, routingKey); } }
public void Accept(PeerCollector peerCollector, BindingKey routingKey) { if (IsLeaf(routingKey) || _matchesAll) { peerCollector.Offer(_peers); return; } if (_sharpNode != null) _sharpNode.Accept(peerCollector, routingKey); if (_starNode != null) _starNode.Accept(peerCollector, routingKey); var nextPart = routingKey.GetPart(_nextPartIndex); if (nextPart == null) return; if (_childrenNodes == null) return; SubscriptionNode childNode; if (_childrenNodes.TryGetValue(nextPart, out childNode)) childNode.Accept(peerCollector, routingKey); }