Created
March 11, 2013 22:22
-
-
Save jaminguy/5138425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_receive(self, response_chunk): | |
self.response_object += str(response_chunk).strip() | |
if response_chunk.endswith("\r\n") and self.response_object.strip(): | |
try: | |
adn_object = self.response_object.strip() | |
self.publish_message(adn_object) | |
except Exception as e: | |
text = "on_receive error {}".format(e) | |
print text | |
log.error(text) | |
except: | |
print "on_receive unknown exception" | |
log.error("on_receive unknown exception") | |
finally: | |
self.response_object = "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment