meteor/mongo-livedata/oplog_observe_driver.js
function () {
    var self = this;
    if (self._stopped)
      return;
    self._stopped = true;
    _.each(self._stopHandles, function (handle) {
      handle.stop();
    });

    // Note: we *don't* use multiplexer.onFlush here because this stop
    // callback is actually invoked by the multiplexer itself when it has
    // determined that there are no handles left. So nothing is actually going
    // to get flushed (and it's probably not valid to call methods on the
    // dying multiplexer).
    _.each(self._writesToCommitWhenWeReachSteady, function (w) {
      w.committed();
    });
    self._writesToCommitWhenWeReachSteady = null;

    // Proactively drop references to potentially big things.
    self._published = null;
    self._unpublishedBuffer = null;
    self._needToFetch = null;
    self._currentlyFetching = null;
    self._oplogEntryHandle = null;
    self._listenersHandle = null;

    Package.facts && Package.facts.Facts.incrementServerFact(
      "mongo-livedata", "observe-drivers-oplog", -1);
  }
function () {
    var self = this;
    if (self._stopped)
      return;
    self._stopped = true;
    _.each(self._stopHandles, function (handle) {
      handle.stop();
    });

    // Note: we *don't* use multiplexer.onFlush here because this stop
    // callback is actually invoked by the multiplexer itself when it has
    // determined that there are no handles left. So nothing is actually going
    // to get flushed (and it's probably not valid to call methods on the
    // dying multiplexer).
    _.each(self._writesToCommitWhenWeReachSteady, function (w) {
      w.committed();
    });
    self._writesToCommitWhenWeReachSteady = null;

    // Proactively drop references to potentially big things.
    self._published = null;
    self._unpublishedBuffer = null;
    self._needToFetch = null;
    self._currentlyFetching = null;
    self._oplogEntryHandle = null;
    self._listenersHandle = null;

    Package.facts && Package.facts.Facts.incrementServerFact(
      "mongo-livedata", "observe-drivers-oplog", -1);
  }
function ( ) { var self = this ; if ( self . _stopped ) return ; self . _stopped = true ; _ . each ( self . _stopHandles , function ( handle ) { handle . stop ( ) ; } ) ; // Note: we *don't* use multiplexer.onFlush here because this stop // callback is actually invoked by the multiplexer itself when it has // determined that there are no handles left. So nothing is actually going // to get flushed (and it's probably not valid to call methods on the // dying multiplexer). _ . each ( self . _writesToCommitWhenWeReachSteady , function ( w ) { w . committed ( ) ; } ) ; self . _writesToCommitWhenWeReachSteady = null ; // Proactively drop references to potentially big things. self . _published = null ; self . _unpublishedBuffer = null ; self . _needToFetch = null ; self . _currentlyFetching = null ; self . _oplogEntryHandle = null ; self . _listenersHandle = null ; Package . facts && Package . facts . Facts . incrementServerFact ( "mongo-livedata" , "observe-drivers-oplog" , - 1 ) ; }
This stop function is invoked from the onStop of the ObserveMultiplexer, so it shouldn't actually be possible to call it until the multiplexer is ready.
This stop function is invoked from the onStop of the ObserveMultiplexer so it shouldn t actually be possible to call it until the multiplexer is ready .