Yaniv Bronhaim has posted comments on this change.
Change subject: stomp: client side subscription ......................................................................
Patch Set 19:
(2 comments)
https://gerrit.ovirt.org/#/c/36368/19/lib/yajsonrpc/stomp.py File lib/yajsonrpc/stomp.py:
Line 379: _frame_handler
There could be more than single message in a frame.
so add comment and explain it above the peek_message call.
Line 547: self._message_handler = message_handler Line 548: self._destination = destination Line 549: Line 550: def handle_message(self, frame): Line 551: self._message_handler(self, frame) message_handler can be none as far as I see.
I really don't understand this message_handler pass over and rolling it from object to object. can't you have one singleton for each handler that we expose (what is it - json handler, stomp handler?)
it's impossible to follow which handler you pass where and if you change it in runtime (which I don't understand any reason to change the handler during runtime). if something that handle messages have states and in each state it uses different handler - the flow should be understandable by reading the class itself and not the usages which control its state from outside. Line 552: Line 553: def set_message_handler(self, handler): Line 554: self._message_handler = handler Line 555: