public void Unsubscribe(string topic, PublishArrivedDelegate subscriber) { topicTree.Remove(topic, subscriber); // TODO: Check if this is the last subscriber Unsubscribe(new string[] { topic }); }
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); }
public void Unsubscribe(string topic, PublishArrivedDelegate subscriber) { topicTree.Remove( topic, subscriber); // TODO: Check if this is the last subscriber Unsubscribe(new string[] { topic } ); }
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); }