Open buffpojken opened 10 years ago
That's a good idea. What kind of notifications were you thinking about? Connected, disconnected? anything else?
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.
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.
@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?