Exemple #1
0
            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);
                }
            }
Exemple #2
0
            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);
                }
            }
Exemple #3
0
            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);
            }