def handleMessageRecievedEvent(self, event): # All we will do a receive event is log it. # Its up to one of our listeners to care about it. log.debug("Received a message of type %s" % str(event.getMessage().__class__)) if isinstance(event.getMessage(), Request): log.debug("Request: %s" % str(event.getMessage())) if isinstance(event.getMessage(), Response): log.debug("Response: %s" % str(event.getMessage()))
def handleMessageSendEvent(self, event): log.debug("Sending a message of type %s" % str(event.getMessage().__class__)) if isinstance(event.getMessage(), Request): log.debug("Request: %s" % event.getMessage().getKey()) if isinstance(event.getMessage(), Response): log.debug("Response: %s" % str(event.getMessage())) if isinstance(event.getTarget(), Connection): event.getTarget().write(str(event.getMessage()))