How to force a client to resubscribe?


So right now when the server comes back up from a crash, clients reconnect and they “re-subscribe” to the publications. Is there a way to force this action?

Here’s the overly simplified version of what I’m after:

Meteor.publish("people", function () {
  self = this;
  _.each( GetDataFromWhoKnowsWhere() , function(person) {
	self.added("people", person._id, person);

  resetPeople: function () {
	// Do something so the client re-subscribes.
	// The client's cache should then have the data 
	// from GetDataFromWhoKnowsWhere().
	// As if the server just came back up from a crash.


Use pure javascript to polling and resubscribe in the same way as GMail which reconnect to your email.


Does work for you?


Thanks for the ideas. In my case I’ll have to create a publication to tell the clients when they have to reconnect. On the clients I’ll have to subscribe to that publication and put Meter.disconnect() and Meteor.reconnect() in an autorun. Not hard, but not a one liner either.