-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SubsManager does not return object with the same API as Meteor.subscribe? (missing stop method) #15
Comments
Yes. This is a current limitation. Arunoda Susiripala On Wed, Jul 23, 2014 at 3:39 PM, Pieter Soudan [email protected]
|
Hey Sewdn, Thought I'd post this since I had the same issue - I needed to clear the cached subscriptions when a user logged out. I ended up using a work around of re-initializing the SubsManager like this:
|
@bryanterrell you need an API to remove all subscriptions. That could be done easily. So, you need an API like |
Yeah, that would be perfect. Thanks |
FYI, my workaround does appear to clear the subs, but the collection I subscribed to still shows data so this didn't work even after updating the cached sub and doing a reset. |
@bryanterrell I've added an .clear() api. |
@arunoda It seems to be working - thanks for addressing this so promptly! |
great. On Sat Feb 07 2015 at 4:21:30 AM Bryan Terrell [email protected]
|
@arunoda What's the status of this ticket? |
To my understanding the problem is that we cannot really |
I think giving a ability to remove a single subscription seems not perfect for the use of this. But it's technically possible. I'm thinking to merge FlowRouter's subscriptions management functionality to this as well. With that, I hope we can do something. |
+1 for finding a solution for this |
@arunoda having trouble with .reset() - when I run it, it removes all docs from client. Seems like it doesn't re-subscribe. |
I can't use the stop() method on subscriptions returned by the SubsManager, whereas I can stop them manually when returned by Meteor.subscribe.
Use case:
I subscribe to a Stats publication for all documents that are clientside available (and don't have an internal cached stats object):
When an event is not clientside available anymore, the stats shouldn't be published anymore and the stats-subscription must be stopped.
I want to cache these subscription, because events happen to be published and unpublished quite a log in my app, and the stats are quite expensive.
This doesn't seem to be possible, because I can't stop the statsSubscription?!
Does this mean, I can just never stop the subscription and they will stop automatically?
It seemed to me the cache would only become stale, when a subscription was stopped (AND cachetime expired)? No?
The text was updated successfully, but these errors were encountered: