Skip to content
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

Unsubscribe a certain subscription #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

haizi-zh
Copy link

@haizi-zh haizi-zh commented Jan 6, 2016

At default, SubsManager caches all subscriptions in _cacheList and _cacheMap. It seems that there're only three ways to unsubscribe them:

  • When the cache is overflown
  • When subscriptions are expired
  • When clear() is called

However, I think sometimes it might be convenience if one can selectively unsubscribe a certain subscription. Here are some relative issues:

I've made several modifications:

  • When subscribe is called, it returns a key, which is essentially a JSON string of the subscription arguments. The key can be used to refer to the specified subscription.
  • A method named unsubscribe is added. This method accept a subscription key, and stop it selectively.

Hope this can help.

@vladholubiev
Copy link

@arunoda any thoughts on this?

@javascriptlove
Copy link

@arunoda bump?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants