Example #1
0
        public void Unsubscribe(string topic, PublishArrivedDelegate subscriber)
        {
            topicTree.Remove(topic, subscriber);

            // TODO: Check if this is the last subscriber
            Unsubscribe(new string[] { topic });
        }
Example #2
0
        public void Subscribe(Subscription subscription, PublishArrivedDelegate subscriber)
        {
            if (topicTree == null)
            {
                topicTree = new TopicTree <PublishArrivedDelegate>();
            }

            topicTree.Add(subscription.Topic, subscriber);

            // TODO: Check if we're already subscribed.
            Subscribe(subscription);
        }
Example #3
0
        public void Unsubscribe(string topic, PublishArrivedDelegate subscriber)
        {
            topicTree.Remove( topic, subscriber);

              // TODO: Check if this is the last subscriber
              Unsubscribe(new string[] { topic } );
        }
Example #4
0
        public void Subscribe(Subscription subscription, PublishArrivedDelegate subscriber)
        {
            if (topicTree == null)
              {
            topicTree = new TopicTree<PublishArrivedDelegate>();
              }

              topicTree.Add( subscription.Topic, subscriber);

              // TODO: Check if we're already subscribed.
              Subscribe(subscription);
        }