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

postal.getSubscribersFor updates #67

Closed
ifandelse opened this issue May 9, 2014 · 3 comments
Closed

postal.getSubscribersFor updates #67

ifandelse opened this issue May 9, 2014 · 3 comments
Assignees

Comments

@ifandelse
Copy link
Contributor

The current getSubscribersFor method can find all subscribers for a given channel and topic. However, it will only look for exact matches to a topic binding (so if you subscribed with "some.topic.#", but you call getSubscribersFor and pass "some.topic.goodness", then the subscription you created with the wildcard binding will NOT be returned in the results.

I'm proposing we change this so that the topic you pass to getSubscribersFor gets compared to the subscription definition topic bindings via the bindingsResolver.

What say you @dcneiner @arobson @nicholascloud @estaylorco?

@ifandelse ifandelse self-assigned this May 9, 2014
@estaylorco
Copy link

@ifandelse I agree with leveraging the bindingsResolver. Any extension to postal should be, I think, internally consistent with the design of postal itself. This is particularly important to me since I use a custom bindingsResolver suggested to me in this forum to handle RESTful style topics instead of AMQP-style topics.

I think I would lose out if the bindingsResolver weren't leveraged (I had overlooked the impact of wildcard matching on the unsubscribeAllFor scenario).

@ifandelse
Copy link
Contributor Author

Ok - this is in rc3 now: https://github.com/postaljs/postal.js/releases/tag/v0.9.0-rc3.

Warning - it does break the API of getSubscribersFor - it now takes either an options object or a predicate, just like unsubscribeFor.

@estaylorco
Copy link

@ifandelse I just downloaded rc3. I'll be playing with the bits this weekend. I don't believe I'm using getSubscribersFor, so I think I'll be fine there.

Thanks, again, for your hard work!

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

No branches or pull requests

2 participants