Skip to content

Instantly share code, notes, and snippets.

@jaminguy
Created March 11, 2013 22:22
Show Gist options
  • Save jaminguy/5138425 to your computer and use it in GitHub Desktop.
Save jaminguy/5138425 to your computer and use it in GitHub Desktop.
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