unsubscribe method

bool unsubscribe(
  1. String topic
)

Implementation

bool unsubscribe(String topic) {
  var ret = false;
  if (_subscriptions.containsKey(topic)) {
    var sub = _subscriptions[topic];

    if (sub != null) {
      ret = sub.remove(this);
      if (sub.isEmpty) {
        _subscriptions.remove(topic);
      }
    }

    _localSubs.remove(topic);
  }
  return ret;
}