gcPeerSubScopes method

void gcPeerSubScopes()

Drops the per-peer sub-scopes that nothing uses. Called by the resource manager's garbage collector; without it this map would keep an entry for every peer that ever used this protocol.

Implementation

void gcPeerSubScopes() {
  _peerSubScopes.removeWhere((_, scope) {
    if (scope.isUnused(ownRefs: 1)) {
      scope.done();
      return true;
    }
    return false;
  });
}