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

Adding notifications? #23

Open
buffpojken opened this issue May 5, 2014 · 3 comments
Open

Adding notifications? #23

buffpojken opened this issue May 5, 2014 · 3 comments

Comments

@buffpojken
Copy link

@jmesnil - I'm thinking of adding support for notifications being posted to the default message center on various events within the library, I need it for a project. Would this be something you're interested in adding to trunk?

@jmesnil
Copy link
Contributor

jmesnil commented May 7, 2014

That's a good idea. What kind of notifications were you thinking about? Connected, disconnected? anything else?

@buffpojken
Copy link
Author

Currently, my list include:

Connected
Disconnected
Reconnected (defined as connection was dropped, but has been reestablished)
Error
Heartbeat failed (if heartbeat is set in the CONNECT/CONNECTED-frames)

Possibly also MessageReceived, but I'm not sure if that one's a good idea, since it might give people the idea to rely on the notification instead of the delegate.

If you or someone else has more notifications to add, I'll be happy to grab a list and start implementing, since I'm already using StompKit heavily in one of our applications.

@jmesnil
Copy link
Contributor

jmesnil commented May 7, 2014

I'm +1 on your list.

I also agree that MessageReceived is not a good idea. In the unlikely case developer want to receive messages through notifications (I am not sure that's a good use case but why not?), they can fire the notification from inside the handler.
The other notifications makes sense to be put inside the StompKit library.

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

No branches or pull requests

2 participants