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

Allow callers of publish() to see how many subscribers were notified. #4

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bernhard-hofmann
Copy link

Adding a return value to the publish method allows callers to determine how many (if any) subscribers received the topic. This would aid debugging because publishers could take action in the event there are no subscribers to the topic at the time the topic is published.

…ermine how many (if any) subscribers received the topic. This would aid debugging because publishers could log when there are no subscribers for the topic at the time the topic is published.
…cribers are mandatory. Added options to allow callers to specify a default for whether topics must have subscribers or not (so that not every publish call needs altering in an application). The options also allow a callback "onNoSubscribers" that overrides the default behaviour which is to log an error if the host has a console, or simply alert if not (I'm looking at you IE6).
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.

1 participant