Skip to content

Commit

Permalink
Make multiple observes of the same Mongo cursor share their polling c…
Browse files Browse the repository at this point in the history
…ycles.

There is no longer any explicit time-based throttling of Mongo poll calls,
though we do prevent multiple instances of polling to be scheduled at once. If
this appears to be a problem, we can reintroduce throttling.

Note: this can lead to a hang if you start observing a cursor during a callback
from an identical cursor's observation. This doesn't seem to be a very realistic
use case though.
  • Loading branch information
glasser committed Nov 15, 2012
1 parent 41b0c28 commit 183653e
Show file tree
Hide file tree
Showing 3 changed files with 459 additions and 95 deletions.
3 changes: 3 additions & 0 deletions packages/livedata/crossbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ _.extend(Meteor._InvalidationCrossbar.prototype, {
//
// XXX It should be legal to call fire() from inside a listen()
// callback?
//
// Note: the LiveResultsSet constructor assumes that a call to listen() never
// yields.
listen: function (trigger, callback) {
var self = this;
var id = self.next_id++;
Expand Down
Loading

0 comments on commit 183653e

Please sign in to comment.