Interesting issue: I\'ve got a MongoDb collection that I\'m updating server side, with Meteor client-side hooks into the same collection. I\'m noticing ~10 second delays for
The meteor mongo driver polls for changes in Mongo every 10 seconds to ensure that data that's written into it from outside Meteor makes its way down to the client. Here's the relevant source code:
// every once and a while, poll even if we don't think we're dirty,
// for eventual consistency with database writes from outside the
// Meteor universe
var intervalHandle = Meteor.setInterval(
_.bind(self._ensurePollIsScheduled, self), 10 * 1000 /* 10 seconds */);
self._stopCallbacks.push(function () {
Meteor.clearInterval(intervalHandle);
});
This behavior is likely to change per Matt Debergalis, one of the core devs:
This polling is so that Meteor will notice DB changes that didn't come through the Meteor server process.
Many apps don't need this, though. We're considering ways to disable it. We also have a more efficient implementation in the hopper.