Exemplo n.º 1
0
        public bool TryAddSubscriber(string topicId, TopicSubscriber item)
        {
            TopicPublisher topic;

            if (TryGetPublisher(topicId, out topic))
            {
                topic.Subscribers[item.HostName] = item;
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        public bool TryGetSubscriber(string topicId, string subscriber, out TopicSubscriber item)
        {
            TopicPublisher topic;

            if (TryGetPublisher(topicId, out topic))
            {
                if (topic.Subscribers.TryGetValue(subscriber, out item))
                {
                    return(true);
                }
            }
            item = null;
            return(false);
        }